diff --git a/js/admin.js b/js/admin.js index 0a4bd20..1b9479d 100644 --- a/js/admin.js +++ b/js/admin.js @@ -237,6 +237,9 @@ export const admin = (() => { }; const init = () => { + session.init(); + user = storage('user'); + if (!session.isAdmin()) { storage('owns').clear(); storage('likes').clear(); @@ -246,12 +249,9 @@ export const admin = (() => { storage('information').clear(); } - session.init(); theme.spyTop(); comment.init(); - user = storage('user'); - if (!session.isAdmin() || !session.getToken() || (JSON.parse(atob((session.getToken() ?? '.').split('.')[1])).exp ?? 0) < (Date.now() / 1000)) { bootstrap.Modal.getOrCreateInstance('#loginModal').show(); return;