update token life extension
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user