adds email confirmation
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import { pb } from "$lib/pocketbase";
|
||||
import { Collection } from "$lib/util/api_util";
|
||||
import { error, type ServerLoad } from "@sveltejs/kit";
|
||||
import { ClientResponseError } from "pocketbase";
|
||||
|
||||
export const load: ServerLoad = async ({ params, locals, url, fetch }) => {
|
||||
if (!params.token) {
|
||||
error(400, "Invalid token")
|
||||
}
|
||||
|
||||
try {
|
||||
await pb.collection(Collection.users).confirmVerification(params.token)
|
||||
} catch (e) {
|
||||
if (e instanceof ClientResponseError) {
|
||||
error(400, e.message);
|
||||
} else {
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
<script lang="ts">
|
||||
import { _ } from "svelte-i18n";
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
<title>{$_("email-verified")} | wanderer</title>
|
||||
</svelte:head>
|
||||
<main class="flex justify-center items-start">
|
||||
<div
|
||||
class="max-w-md border border-input-border rounded-xl p-8 flex flex-col justify-center items-center gap-4 w-[28rem] mt-8"
|
||||
>
|
||||
<i class="fa fa-check-circle text-emerald-400 text-7xl"></i>
|
||||
<h4 class="text-xl font-semibold">{$_("email-verified")}</h4>
|
||||
<div class="space-y-6 w-80">
|
||||
<p class="text-center">
|
||||
Thank you, your email was verified. Enjoy using wanderer!
|
||||
</p>
|
||||
</div>
|
||||
<a class="btn-primary mt-4" href="/">{$_("home")}</a>
|
||||
</div>
|
||||
</main>
|
||||
Reference in New Issue
Block a user