diff --git a/tfweb/src/lib/cookie.ts b/tfweb/src/lib/cookie.ts new file mode 100644 index 0000000..01e3063 --- /dev/null +++ b/tfweb/src/lib/cookie.ts @@ -0,0 +1,22 @@ +export function setCookie(name: string, value: string, expires: number) { + const d = new Date(); + d.setTime(d.getTime() + expires); + const expires_at = "expires="+ d.toUTCString(); + document.cookie = name + "=" + value + ";" + expires_at + ";path=/"; +} + +function getCookie(name: string): string { + const name_with_equals = name + "="; + const decodedCookie = decodeURIComponent(document.cookie); + const ca = decodedCookie.split(';'); + for(let i = 0; i
- {#if hasError} {error} diff --git a/tfweb/src/routes/auth/magic-link/+page.svelte b/tfweb/src/routes/auth/magic-link/+page.svelte index 029c025..0ed49b2 100644 --- a/tfweb/src/routes/auth/magic-link/+page.svelte +++ b/tfweb/src/routes/auth/magic-link/+page.svelte @@ -1,8 +1,78 @@
@@ -10,8 +80,17 @@ {#if isLoading}

{t('magiclink.loadtitle')}

-

{t('magiclink.loadsubtitle')}

+

{t('magiclink.loadsubtitle')}

+ {:else} + {#if hasError} +

{t('magiclink.failed')}

+

{error}

+ {t('magiclink.tryAgain')} + {:else} +

{t('magiclink.finished')}

+

{t('magiclink.redirecting')}

+ {/if} {/if}
\ No newline at end of file