-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7ab5904
commit 2918c2c
Showing
7 changed files
with
40 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,23 @@ | ||
<script lang="ts"> | ||
import { goto } from '$app/navigation'; | ||
import { page } from '$app/state'; | ||
import { on } from 'svelte/events'; | ||
import { goto } from "$app/navigation"; | ||
import { page } from "$app/state"; | ||
import { on } from "svelte/events"; | ||
console.log(page); | ||
</script> | ||
|
||
<div class="flex my-4 flex-col items-center space-y-4"> | ||
{#if page.status ==403 || page.status ==401} | ||
<p> | ||
Authentication required | ||
</p> | ||
<button class="btn btn-primary" onclick={() => {goto(`/login?redirect=${encodeURIComponent(page.url.pathname)}`)}}> | ||
Login / Sign up | ||
</button> | ||
</script> | ||
|
||
<div class="flex my-4 flex-col items-center space-y-4"> | ||
{#if page.status == 403 || page.status == 401} | ||
<p>Authentication required</p> | ||
<button | ||
class="btn btn-primary" | ||
onclick={() => { | ||
goto(`/login?redirect=${encodeURIComponent(page.url.pathname)}`); | ||
}} | ||
> | ||
Login / Sign up | ||
</button> | ||
{:else} | ||
<h1>Error {page.status ?? 'Unknown error code'}</h1> | ||
<h1>{page.error?.message ?? 'Unknown error message'}</h1> | ||
<h1>Error {page.status ?? "Unknown error code"}</h1> | ||
<h1>{page.error?.message ?? "Unknown error message"}</h1> | ||
{/if} | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters