This is the template project that's checked out and configured when you run the bando-up command from ljsthw-bandolier. This is where the code really lives.
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.
 
 
 
 
bandolier-template/client/pages/Login.svelte

26 lines
745 B

<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>