feat: unauthorized page

This commit is contained in:
Ax333l 2023-03-05 15:35:37 +01:00
parent 0d6974e00d
commit 575ea74ab5
No known key found for this signature in database
GPG Key ID: D2B4D85271127D23
2 changed files with 21 additions and 1 deletions

View File

@ -7,6 +7,7 @@
import Modal from '$lib/components/atoms/Dialogue.svelte'; import Modal from '$lib/components/atoms/Dialogue.svelte';
import LogoOption from '$lib/components/atoms/LogoOption.svelte'; import LogoOption from '$lib/components/atoms/LogoOption.svelte';
import Button from '$lib/components/atoms/Button.svelte'; import Button from '$lib/components/atoms/Button.svelte';
import { goto } from '$app/navigation';
interface Selected { interface Selected {
[key: string]: string[]; [key: string]: string[];
@ -102,8 +103,10 @@
} catch (err) { } catch (err) {
alert(`Could not exchange the token: ${err}`); alert(`Could not exchange the token: ${err}`);
} }
} else if (localStorage.getItem('killswitch') === null) {
await goto('/poll/unauthorized/');
} else { } else {
alert('Warning: No token!'); alert('Warning: no token!');
} }
}); });

View File

@ -0,0 +1,17 @@
<svelte:head>
<title>ReVanced · Error</title>
<meta content="ReVanced · Error" name="og:title" />
<meta content="ReVanced · Error" name="twitter:title" />
</svelte:head>
<main>
<h1>Unauthorized</h1>
<h2>Please follow the instructions in our Discord server to vote.</h2>
</main>
<style>
main {
text-align: center;
padding-top: 10rem;
}
</style>