feat: log staff sign-in and sign-out and force logout at a set time
This commit is contained in:
@@ -157,7 +157,12 @@ export const useAuthStore = defineStore('auth', () => {
|
||||
persist(data);
|
||||
}
|
||||
|
||||
function logout() {
|
||||
async function logout() {
|
||||
try {
|
||||
if (token.value) await api.post('/auth/logout');
|
||||
} catch {
|
||||
/* نشست ممکن است از قبل بسته شده باشد */
|
||||
}
|
||||
token.value = null;
|
||||
user.value = null;
|
||||
clearAvatarUrl();
|
||||
|
||||
Reference in New Issue
Block a user