Clear auth token on login and OAuth login

This commit is contained in:
Torsten Dittmann
2025-12-09 19:33:09 +04:00
parent 831af2343a
commit 29986bcbaa
@@ -20,6 +20,7 @@
async function login() {
try {
clearAuthToken();
disabled = true;
await sdk.forConsole.account.createEmailPasswordSession({
email: mail,
@@ -65,6 +66,7 @@
}
function onOauthLogin(config: { provider: OAuthProvider; scopes: string[] }) {
clearAuthToken();
let url = window.location.origin;
if (page.url.searchParams) {
@@ -83,6 +85,10 @@
scopes: config.scopes
});
}
function clearAuthToken() {
localStorage.removeItem('imagine-auth-token');
}
</script>
<svelte:head>