fix login/logout paths, reload page instead fancy css because the csrf token gets renewed after every login/logout
This commit is contained in:
parent
fb2a1cd4b6
commit
39b3519266
@ -238,13 +238,15 @@ $(document).ready(function() {
|
||||
});
|
||||
|
||||
function login(args, form_data) {
|
||||
$('body').css('cursor', 'progress');
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/coinc/accounts/login/',
|
||||
url: './accounts/login/',
|
||||
data: form_data,
|
||||
success: function(response) {
|
||||
// TODO nötig, da der csrf-token nach dem anmelden geändert wird und ich mir erst den neuen holen muss.
|
||||
window.open(window.location.href, '_self');
|
||||
//detach('#login');
|
||||
detach('#login');
|
||||
//$('button#do_login').addClass('d-none');
|
||||
//$('button#begin_edit').removeClass('d-none');
|
||||
//$('button#do_logout').removeClass('d-none');
|
||||
@ -255,19 +257,20 @@ $(document).ready(function() {
|
||||
|
||||
// logout
|
||||
$('#do_logout').click(function() {
|
||||
let data = { csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val() };
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: data,
|
||||
url: '/coinc/accounts/logout/',
|
||||
success: function(response) {
|
||||
window.open(window.location.href, '_self');
|
||||
//detach('login');
|
||||
//$('button#do_logout').addClass('d-none');
|
||||
//$('button#begin_edit').addClass('d-none');
|
||||
//$('button#do_login').removeClass('d-none');
|
||||
}
|
||||
});
|
||||
$('body').css('cursor', 'progress');
|
||||
let data = { csrfmiddlewaretoken: $('input[name=csrfmiddlewaretoken]').val() };
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
data: data,
|
||||
url: './accounts/logout/',
|
||||
success: function(response) {
|
||||
// TODO nötig, da der csrf-token nach dem anmelden geändert wird und ich mir erst den neuen holen muss.
|
||||
window.open('./', '_self');
|
||||
//$('button#do_logout').addClass('d-none');
|
||||
//$('button#begin_edit').addClass('d-none');
|
||||
//$('button#do_login').removeClass('d-none');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user