Merge pull request #2583 from bearstech/dynamic-root-url

set root_url js var in template so we can use a PATH_PREFIX without b…
This commit is contained in:
Antoine Nguyen
2022-09-05 12:59:29 +02:00
committed by GitHub
2 changed files with 3 additions and 2 deletions
+2 -2
View File
@@ -177,7 +177,7 @@ TwocolsNav.prototype = {
startTFASetup: function (evt) {
evt.preventDefault();
$.ajax({
url: '/api/v1/account/tfa/setup/',
url: window.root_url + '/api/v1/account/tfa/setup/',
type: 'post',
contentType: 'application/json'
}).done(function (resp) {
@@ -191,7 +191,7 @@ TwocolsNav.prototype = {
pin_code: $('#pin-code').val()
};
$.ajax({
url: '/api/v1/account/tfa/setup/check/',
url: window.root_url + '/api/v1/account/tfa/setup/check/',
type: 'post',
global: false,
data: JSON.stringify(data),
+1
View File
@@ -87,6 +87,7 @@
<script src="{% static 'js/top_notifications.js' %}" type="text/javascript"></script>
<script type="text/javascript" src="{% url 'javascript-catalog' %}"></script>
<script type="text/javascript">
var root_url = "{% url 'core:root' %}".replace(/\/$/, "");
var top_notifications;
var userLang = "{{ LANGUAGE_CODE }}";