mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
Clear auth token on login and OAuth login
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user