refac
This commit is contained in:
@@ -2,7 +2,6 @@
|
||||
import { getContext } from 'svelte';
|
||||
import { toast } from 'svelte-sonner';
|
||||
import { updateUserPassword, userSignOut } from '$lib/apis/auths';
|
||||
import { user } from '$lib/stores';
|
||||
import SensitiveInput from '$lib/components/common/SensitiveInput.svelte';
|
||||
|
||||
const i18n = getContext('i18n');
|
||||
@@ -27,17 +26,13 @@
|
||||
// This session is no longer trusted once the password it was issued under changes
|
||||
toast.success($i18n.t('Password updated. Please sign in again.'));
|
||||
|
||||
localStorage.removeItem('token');
|
||||
user.set(null);
|
||||
|
||||
const signOutRes = await userSignOut().catch((error) => {
|
||||
console.error(error);
|
||||
return null;
|
||||
});
|
||||
|
||||
if (signOutRes?.redirect_url) {
|
||||
location.href = signOutRes.redirect_url;
|
||||
}
|
||||
localStorage.removeItem('token');
|
||||
location.href = signOutRes?.redirect_url ?? '/auth?logout=true';
|
||||
}
|
||||
|
||||
currentPassword = '';
|
||||
|
||||
Reference in New Issue
Block a user