aboutsummaryrefslogtreecommitdiff
path: root/src/routes/verify/+page.svelte
diff options
context:
space:
mode:
authormat <27899617+mat-1@users.noreply.github.com>2022-12-15 20:19:42 -0600
committerGitHub <noreply@github.com>2022-12-15 20:19:42 -0600
commited5eedab8f9fc90dadf5c442cf559572d1b35f0c (patch)
tree01a763fd11810e9970f14f7dae180e95b279de9a /src/routes/verify/+page.svelte
parent89bf3d31e36ad3bdfd45461ee6fb69a4c791f848 (diff)
parent103689520f51991a1e9a4ca5829fe2f46d1a32c2 (diff)
downloadskyblock-stats-ed5eedab8f9fc90dadf5c442cf559572d1b35f0c.tar.gz
skyblock-stats-ed5eedab8f9fc90dadf5c442cf559572d1b35f0c.tar.bz2
skyblock-stats-ed5eedab8f9fc90dadf5c442cf559572d1b35f0c.zip
Merge pull request #6 from skyblockstats/sveltekit-v1
Sveltekit v1
Diffstat (limited to 'src/routes/verify/+page.svelte')
-rw-r--r--src/routes/verify/+page.svelte53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/routes/verify/+page.svelte b/src/routes/verify/+page.svelte
new file mode 100644
index 0000000..4edc50d
--- /dev/null
+++ b/src/routes/verify/+page.svelte
@@ -0,0 +1,53 @@
+<script lang="ts">
+ import Emoji from '$lib/Emoji.svelte'
+ import Head from '$lib/Head.svelte'
+ import Header from '$lib/Header.svelte'
+ import type { PageData } from './$types'
+
+ export let data: PageData
+
+ export let errorCode: string | null = data.errorCode
+ export let current: string | null = data.current
+ export let correct: string | null = data.correct
+
+ const errorCodes = {
+ NO_IGN: 'Please enter a valid Minecraft username.',
+ NOT_LINKED:
+ 'Please link your Discord in Hypixel by doing /profile -> Social media -> Discord. If you just changed it, wait a few minutes and try again.',
+ WRONG_NAME: `You're linked to ${current} on Hypixel. Please change this to ${correct} by doing /profile -> Social media -> Discord. If you just changed it, wait a few minutes and try again.`,
+ NO_KEY:
+ "This instance of skyblock-stats doesn't have a skyblock-api key set. Please contact the owner of the website if you believe this to be a mistake.",
+ }
+</script>
+
+<Head title="Verify Account" />
+<Header />
+
+<main>
+ <h1>Verify Minecraft account</h1>
+ <p>Please enter your Minecraft username to verify that this is your account.</p>
+ <p>
+ This will check with the Hypixel API that your Discord username matches the Discord name set in
+ your Hypixel settings.
+ </p>
+ {#if errorCode && errorCode in errorCodes}
+ <div class="error">
+ <Emoji value="🚫" />
+ {errorCodes[errorCode]}
+ </div>
+ {/if}
+ <form method="post" action="/verify">
+ <input placeholder="Username or UUID" name="ign" required />
+ <input type="submit" value="Enter" />
+ </form>
+</main>
+
+<style>
+ p {
+ margin: 0;
+ }
+ .error {
+ font-weight: bold;
+ margin: 1em 0;
+ }
+</style>