update token life extension

This commit is contained in:
smanylov
2026-01-20 16:53:11 +07:00
parent 2b7ba7255a
commit 7d7213b457
10 changed files with 72 additions and 54 deletions
+3 -3
View File
@@ -20,7 +20,6 @@ export async function logout() {
throw error;
} finally {
await deleteSession();
redirect('/login');
}
}
@@ -316,11 +315,12 @@ export async function tokenLifeExtension() {
if (response.ok) {
const parsed = await response.json();
await updateSession();
if (parsed.message_code === 0) {
await updateSession(parsed.message_body.token);
}
}
} catch (error) {
await deleteSession();
redirect('/login');
throw error;
}
}