Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 1 addition & 11 deletions src/routes/auth/magic-url/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,11 @@
import { goto } from '$app/navigation';
import { page } from '$app/stores';
import { Heading } from '$lib/components';
import { Account, Client } from '@appwrite.io/console';
import { onMount } from 'svelte';

const client = new Client();
const account = new Account(client);

onMount(async () => {
const projectId = $page.url.searchParams.get('project');
client.setEndpoint(`${$page.url.origin}/v1`).setProject(projectId);

const userId = $page.url.searchParams.get('userId');
const secret = $page.url.searchParams.get('secret');

await account.updateMagicURLSession(userId, secret);
await goto(`appwrite-callback-${projectId}://${$page.url.search}`);
await goto(`appwrite-callback-auth-${projectId}://appwrite.io/magic-url${$page.url.search}`);
});
</script>

Expand Down