mirror of
https://github.com/whoswhip/Sharpbin.git
synced 2026-12-06 02:48:43 +00:00
feat: email verification via smtp
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { apiUrl } from '$lib/server/api';
|
||||
import { extractError } from '$lib/utils/misc';
|
||||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const load = async ({ url }) => {
|
||||
const token = url.searchParams.get('token');
|
||||
if (token) {
|
||||
const res = await fetch(`${apiUrl}/api/auth/verify-email?token=${token}`);
|
||||
if (!res.ok) {
|
||||
const json = await res.json().catch();
|
||||
const message = extractError(json);
|
||||
throw error(res.status, message ?? 'Request failed');
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,11 @@
|
||||
<main
|
||||
class="flex min-h-[calc(100vh-120px)] w-full flex-col items-center justify-center pt-5 pb-5 text-white"
|
||||
>
|
||||
<div
|
||||
class="w-[95%] max-w-7xl rounded border-2
|
||||
border-neutral-800 bg-neutral-900 p-6 text-center"
|
||||
>
|
||||
<h1 class="mb-4 text-4xl font-bold">Email verified.</h1>
|
||||
<p class="mb-2 text-lg">You may close this page.</p>
|
||||
</div>
|
||||
</main>
|
||||
Reference in New Issue
Block a user