1
mirror of https://gitlab.com/commento/commento.git synced 2025-06-29 22:56:37 -04:00

self.js: delete invalid cookie before redirecting

This commit is contained in:
Adhityaa Chandrasekar
2018-08-08 11:30:59 +05:30
parent c71d634e82
commit 12d9d52555
2 changed files with 12 additions and 0 deletions

View File

@ -6,8 +6,14 @@
"ownerToken": global.cookieGet("commentoOwnerToken"),
};
if (json.ownerToken === undefined) {
document.location = "/login";
return;
}
global.post(global.commentoOrigin + "/api/owner/self", json, function(resp) {
if (!resp.success || !resp.loggedIn) {
global.cookieDelete("commentoOwnerToken");
document.location = "/login";
return;
}