This commit is contained in:
Timothy Jaeryang Baek
2026-08-30 23:50:30 -04:00
parent aeb126b95d
commit e4dbfb1276
4 changed files with 10 additions and 11 deletions
@@ -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 = '';