Closes issue: OwlBoard/backend#39
Still awaiting the check auth endpoint, the code only acts on a 401 response. That means that it currently will not detect if an account is expired.
This commit is contained in:
@@ -7,7 +7,10 @@
|
||||
<svelte:head>
|
||||
<meta name="application-name" content="OwlBoard" />
|
||||
<meta name="author" content="Frederick Boniface" />
|
||||
<meta name="description" content="Get instant access to live train data, PIS codes, and location reference codes. Built by railway staff, for railway staff – your fastest route to accurate information." />
|
||||
<meta
|
||||
name="description"
|
||||
content="Get instant access to live train data, PIS codes, and location reference codes. Built by railway staff, for railway staff – your fastest route to accurate information."
|
||||
/>
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta name="theme-color" content="#00b7b7" />
|
||||
<link rel="icon" href="/images/icon.svg" type="image/svg+xml" />
|
||||
@@ -16,6 +19,6 @@
|
||||
<title>OwlBoard</title>
|
||||
</svelte:head>
|
||||
{#if dev}
|
||||
<DevBanner />
|
||||
<DevBanner />
|
||||
{/if}
|
||||
<slot />
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import Header from '$lib/navigation/header.svelte';
|
||||
import LogoutButton from '$lib/navigation/LogoutButton.svelte';
|
||||
import Header from '$lib/navigation/header.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import { uuid } from '$lib/stores/uuid.js';
|
||||
@@ -45,6 +46,8 @@
|
||||
{:else if data[0].domain != 'User not Found'}
|
||||
<p class="api_response">Registration Domain: {data[0]['domain']}</p>
|
||||
<p class="api_response">Access Time: {data[0]['atime']}</p>
|
||||
<LogoutButton />
|
||||
<p>Clicking the logout button will delete your data from your browser. You will then be able to make a new account, your old account will remain inactive and be deleted after 90 days.</p>
|
||||
{:else}
|
||||
<p class="api_response">You are not registered, we don't have any data stored.</p>
|
||||
{/if}
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
import Nav from '$lib/navigation/nav.svelte';
|
||||
import Loading from '$lib/navigation/loading.svelte';
|
||||
import { onMount } from 'svelte';
|
||||
import { uuid } from '$lib/stores/uuid.js';
|
||||
import { checkAuth } from '$lib/libauth';
|
||||
import { checkAuth, logout } from '$lib/libauth';
|
||||
import LogoutButton from '$lib/navigation/LogoutButton.svelte';
|
||||
|
||||
const title = 'Register';
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
onMount(async () => {
|
||||
const auth = await checkAuth();
|
||||
if (auth.uuidPresent === false) {
|
||||
state = 'unreg';
|
||||
state = 'unreg';
|
||||
} else if (auth.uuidPresent === true) {
|
||||
state = 'reg';
|
||||
}
|
||||
@@ -50,54 +50,57 @@
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<Header {title} />
|
||||
{#if isLoading}
|
||||
<Loading />
|
||||
{:else}
|
||||
{#if state == 'unreg'}
|
||||
<p>The staff version of OwlBoard offers several extra features:</p>
|
||||
<ul>
|
||||
<li>Access the Train Finder</li>
|
||||
<li>Access the PIS Finder</li>
|
||||
<li>More detailed departure boards:</li>
|
||||
|
||||
<section class="content">
|
||||
{#if isLoading}
|
||||
<Loading />
|
||||
{:else if state == 'unreg'}
|
||||
<p>The staff version of OwlBoard offers several extra features:</p>
|
||||
<ul>
|
||||
<li>Non-Passenger movements</li>
|
||||
<li>Hidden platform numbers</li>
|
||||
<li>Display up to 25 services</li>
|
||||
<li>Access the Train Finder</li>
|
||||
<li>Access the PIS Finder</li>
|
||||
<li>More detailed departure boards:</li>
|
||||
<ul>
|
||||
<li>Non-Passenger movements</li>
|
||||
<li>Hidden platform numbers</li>
|
||||
<li>Display up to 25 services</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</ul>
|
||||
<p>To register, you will need to enter a work email address to receive a confirmation email</p>
|
||||
<form on:submit={request}>
|
||||
<input type="text" autocomplete="email" placeholder="Enter work email" bind:value={inputValue} on:input={handleInput} /><br />
|
||||
<label for="checkbox">
|
||||
I have read and accept the terms of the <a href="/more/privacy">Privacy Policy</a><br />
|
||||
<input id="checkbox" type="checkbox" required />
|
||||
</label><br />
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
{:else if state == 'sent'}
|
||||
<p>An email has been sent, click the link in the email to activate your profile.</p>
|
||||
<p>When you click the link, your authorisation key will be automatically be stored in your browser.</p>
|
||||
<p>If you use multiple browsers, you will only be logged in using the browser you open the link with.</p>
|
||||
<p>You will be able to register again using the same email address</p>
|
||||
{:else if state == 'unauth'}
|
||||
<p>The email address you entered does not belong to an authorised business.</p>
|
||||
<p>If you think this is an error, you can report an issue in the 'More' menu.</p>
|
||||
{:else if state == 'error'}
|
||||
<p>There was an error processing your request.</p>
|
||||
<p>Check that the email you entered was correct or try again later.</p>
|
||||
{:else if state == 'reg'}
|
||||
<p>
|
||||
You are already registered for OwlBoard. If you've recently logged out or updated, you may need to refresh this page to register as old data could still be stored in your
|
||||
browser.
|
||||
</p>
|
||||
{/if}
|
||||
{/if}
|
||||
<p>To register, you will need to enter a work email address to receive a confirmation email</p>
|
||||
<form on:submit={request}>
|
||||
<input type="text" autocomplete="email" placeholder="Enter work email" bind:value={inputValue} on:input={handleInput} /><br />
|
||||
<label for="checkbox">
|
||||
I have read and accept the terms of the <a href="/more/privacy">Privacy Policy</a><br />
|
||||
<input id="checkbox" type="checkbox" required />
|
||||
</label><br />
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
{:else if state == 'sent'}
|
||||
<p>An email has been sent, click the link in the email to activate your profile.</p>
|
||||
<p>When you click the link, your authorisation key will be automatically be stored in your browser.</p>
|
||||
<p>If you use multiple browsers, you will only be logged in using the browser you open the link with.</p>
|
||||
<p>You will be able to register again using the same email address</p>
|
||||
{:else if state == 'unauth'}
|
||||
<p>The email address you entered does not belong to an authorised business.</p>
|
||||
<p>If you think this is an error, you can report an issue by <a href="/more/report">reporting an issue</a>.</p>
|
||||
{:else if state == 'error'}
|
||||
<p>There was an error processing your request.</p>
|
||||
<p>Check that the email you entered was correct or try again later.</p>
|
||||
{:else if state == 'reg'}
|
||||
<p>
|
||||
You are already registered for OwlBoard. If you've recently logged out or updated, you may need to refresh this page to register as old data could still be stored in your
|
||||
browser.
|
||||
</p>
|
||||
<LogoutButton />
|
||||
{/if}
|
||||
</section>
|
||||
<Nav />
|
||||
|
||||
<style>
|
||||
.content {
|
||||
margin-top: 30px;
|
||||
}
|
||||
p {
|
||||
margin: 10px;
|
||||
}
|
||||
|
||||
@@ -26,13 +26,13 @@
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/owlboard-svelte" target="_blank">Web-app version<br /><span class="data">{version}-{versionTag}</span></a>
|
||||
</p>
|
||||
<p>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/backend" target="_blank">API Server version<br /><span class="data">{data?.backend || "Unknown"}</span></a>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/backend" target="_blank">API Server version<br /><span class="data">{data?.backend || 'Unknown'}</span></a>
|
||||
</p>
|
||||
<p>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/db-manager" target="_blank">DB Manager version<br /><span class="data">{data?.['db-manager'] || 'Unknown'}</span></a>
|
||||
</p>
|
||||
<p>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/mq-client" target="_blank">MQ Client version<br><span class="data">{data?.['mq-client'] || 'Not installed'}</span></a>
|
||||
<a class="data" href="https://git.fjla.uk/owlboard/mq-client" target="_blank">MQ Client version<br /><span class="data">{data?.['mq-client'] || 'Not installed'}</span></a>
|
||||
</p>
|
||||
</Island>
|
||||
{:catch}
|
||||
|
||||
Reference in New Issue
Block a user