mirror of
https://github.com/appwrite/console.git
synced 2026-06-06 19:27:48 +00:00
15 lines
515 B
TypeScript
15 lines
515 B
TypeScript
import { sdk } from '$lib/stores/sdk';
|
|
import { goto, invalidate } from '$app/navigation';
|
|
import { Dependencies } from '$lib/constants';
|
|
import { Submit, trackEvent } from '$lib/actions/analytics';
|
|
import { base } from '$app/paths';
|
|
import { uploader } from '$lib/stores/uploader';
|
|
|
|
export async function logout() {
|
|
await sdk.forConsole.account.deleteSession('current');
|
|
await invalidate(Dependencies.ACCOUNT);
|
|
uploader.reset();
|
|
trackEvent(Submit.AccountLogout);
|
|
await goto(`${base}/login`);
|
|
}
|