Skip to content

Commit

Permalink
Use csrf cookie name from django settings (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekratskih committed Jul 28, 2021
1 parent 1703f12 commit 5bc93a5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion orchestra/static/dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -47351,7 +47351,7 @@ angular.module('orchestra', ['ngRoute', _commonModuleEs2.default, _timingModuleE
// Update xsrf $http headers to align with Django's defaults

$http.defaults.xsrfHeaderName = 'X-CSRFToken';
$http.defaults.xsrfCookieName = 'csrftoken';
$http.defaults.xsrfCookieName = window.orchestra.csrf_cookie_name || 'csrftoken';

// Change title based on route
var baseTitle = ' | Orchestra';
Expand Down
2 changes: 1 addition & 1 deletion orchestra/static/orchestra/main.es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ angular

// Update xsrf $http headers to align with Django's defaults
$http.defaults.xsrfHeaderName = 'X-CSRFToken'
$http.defaults.xsrfCookieName = 'csrftoken'
$http.defaults.xsrfCookieName = window.orchestra.csrf_cookie_name || 'csrftoken'

// Change title based on route
var baseTitle = ' | Orchestra'
Expand Down
1 change: 1 addition & 0 deletions orchestra/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ def index(request):
orchestra_arguments = {
'angular_modules': [],
'angular_directives': defaultdict(lambda: defaultdict(lambda: {})),
'csrf_cookie_name': settings.CSRF_COOKIE_NAME,
}

for step in Step.objects.filter(is_human=True):
Expand Down

0 comments on commit 5bc93a5

Please sign in to comment.