Skip to content
Snippets Groups Projects
Commit 71dae469 authored by William Enright's avatar William Enright
Browse files

changed endpoint use to login DELETE for logouts, deleting jwt from local storage

parent c22670d6
No related branches found
No related tags found
No related merge requests found
......@@ -26,8 +26,6 @@
function signupPageHandler(data, statusCode, jqXHR) {
// create Admin
console.log(data);
console.log(data.getResponseHeader('showLogin'));
if(data.getResponseHeader('showLogin') == "false") {
var inputConfirmPassword = '<div class="form-label-group"><label for="confirmPassword" class="label-title">Confirm Password</label><input type="password" name="confirmPassword" id="inputConfirmPassword" class="form-control" required autocomplete="off"><span id="message"></span></div>';
......@@ -58,8 +56,10 @@ function checkAuthentication() {
getServerConfigStatus();
}
function setLogout() {
return true;
function setLogout(data) {
if (data.status == 200) {
window.localStorage.removeItem('access_token');
}
}
function authorizedAdmin() {
......
......@@ -59,7 +59,7 @@
$(".goSignup").on('click',function() {
eraseCookie(keyUsername);
eraseCookie(keyAdmin);
ajaxApiCall(api_path_get_logout, 'GET', null, null, setLogout, false);
ajaxApiCall(api_path_post_auth_login, 'DELETE', null, null, setLogout, false);
window.location.href = "../templates/signup.html";
});
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment