From 7b34d4e857f28466d04703e87de040f1d60d2cdb Mon Sep 17 00:00:00 2001 From: "Amy J. Ko" Date: Fri, 11 Oct 2024 20:32:15 -0700 Subject: [PATCH] Fixed profile links and redirect. --- src/lib/Page.svelte | 3 ++- src/routes/login/+page.svelte | 5 +++-- src/routes/person/[personid]/+page.svelte | 2 +- supabase/config.toml | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/Page.svelte b/src/lib/Page.svelte index 9c354c5..98de85b 100644 --- a/src/lib/Page.svelte +++ b/src/lib/Page.svelte @@ -20,7 +20,8 @@ {#if $navigating}{/if} diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index 836c530..74e4ec8 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -35,18 +35,19 @@ async function login() { submitting = true; - const { error } = await supabase.auth.verifyOtp({ email, token: code, type: 'email' }); + const { data, error } = await supabase.auth.verifyOtp({ email, token: code, type: 'email' }); if (error) message = error.code ?? error.message; else { submitted = false; message = null; + if (data.user?.id) goto(`/person/${data.user.id}`); } submitting = false; } // Already signed in? Go to the profile. - $: if (browser && $user) goto(`/person/${$user.id}`); + // $: if (browser && $user) goto(`/person/${$user.id}`); $: emailActive = !submitting && validEmail(email); diff --git a/src/routes/person/[personid]/+page.svelte b/src/routes/person/[personid]/+page.svelte index 034efea..591245f 100644 --- a/src/routes/person/[personid]/+page.svelte +++ b/src/routes/person/[personid]/+page.svelte @@ -32,7 +32,7 @@ {:then orgs} {#if orgs.data === null} - + {:else if $user} Hi {$user.email}! diff --git a/supabase/config.toml b/supabase/config.toml index 2b939ed..a56110e 100644 --- a/supabase/config.toml +++ b/supabase/config.toml @@ -151,7 +151,7 @@ url = "" skip_nonce_check = false [analytics] -enabled = false +enabled = true port = 54327 vector_port = 54328 # Configure one of the supported backends: `postgres`, `bigquery`.