your personal website on atproto - mirror blento.app

Merge pull request #127 from flo-bit/show-login-error

show login error

authored by

Florian and committed by
GitHub
ee06bdd8 8643d6b2

+24 -1
+24 -1
src/routes/(auth)/oauth/callback/+page.svelte
··· 3 3 import { user } from '$lib/atproto'; 4 4 import { getHandleOrDid } from '$lib/atproto/methods'; 5 5 6 + let showError = $state(false); 7 + 8 + let startedErrorTimer = $state(); 9 + 6 10 $effect(() => { 7 11 if (user.profile) { 8 12 goto('/' + getHandleOrDid(user.profile) + '/edit', {}); 9 13 } 14 + 15 + if(!user.isInitializing && !startedErrorTimer) { 16 + startedErrorTimer = true; 17 + 18 + setTimeout(() => { 19 + showError = true; 20 + }, 3000); 21 + } 10 22 }); 11 23 </script> 12 24 13 - <div class="flex min-h-screen w-full items-center justify-center text-3xl">Loading...</div> 25 + {#if user.isInitializing || !showError} 26 + <div class="flex min-h-screen w-full items-center justify-center text-3xl">Loading...</div> 27 + {:else if showError} 28 + <div class="flex min-h-screen w-full items-center justify-center text-3xl"> 29 + <span class="max-w-xl text-center font-medium" 30 + >There was an error signing you in, please go back to the 31 + <a class="text-accent-600 dark:text-accent-400" href="/">homepage</a> 32 + and try again. 33 + 34 + </span> 35 + </div> 36 + {/if}