This is the code that runs https://bandolier.learnjsthehardway.com/ for you to review. It uses the https://git.learnjsthehardway.com/learn-javascript-the-hard-way/bandolier-template to create the documentation for the project.
https://bandolier.learnjsthehardway.com/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
745 B
27 lines
745 B
2 years ago
|
<script>
|
||
|
import Login from '$/client/components/Login.svelte';
|
||
|
import Layout from '$/client/Layout.svelte';
|
||
|
import { user } from '$/client/stores.js';
|
||
|
import { push } from 'svelte-spa-router';
|
||
|
import { log } from "$/client/logging.js";
|
||
|
|
||
|
$: if($user.authenticated) {
|
||
|
log.debug("user is already authenticated");
|
||
|
push("/");
|
||
|
}
|
||
|
|
||
|
const force_home = () => {
|
||
|
window.location = "/";
|
||
|
}
|
||
|
</script>
|
||
|
|
||
|
<Layout testid="page-login" centered={ true }>
|
||
|
{#if $user.new_registration}
|
||
|
<callout style="width: var(--width-card);">Welcome! Your registration is complete. Log in with your username/password to begin.
|
||
|
</callout>
|
||
|
{/if}
|
||
|
|
||
|
<Login on:authenticated={ () => push('/') }
|
||
|
on:canceled={ force_home } />
|
||
|
</Layout>
|