Skip to content

Commit

Permalink
Add automatic redirection to login page on key press
Browse files Browse the repository at this point in the history
  • Loading branch information
Wrench56 committed Jul 16, 2024
1 parent 0ed138e commit 05027ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/frontend/src/routes/blocked/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@
}
</script>

<svelte:window on:keydown|preventDefault={redirect} />

<h1>Blocked</h1>
<p>You are not logged in!</p>
<p>You are not logged in!
Press any key to be redirected.</p>

<!-- svelte-ignore a11y-click-events-have-key-events -->
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
Expand All @@ -20,6 +23,7 @@
p {
color: whitesmoke;
font-family: monaco, Consolas, "Lucida Console", monospace;
white-space: pre-line;
}
.redirect {
Expand Down

0 comments on commit 05027ae

Please sign in to comment.