blank sveltekit project

This commit is contained in:
2026-02-27 16:23:27 +01:00
parent 8f49b73aa8
commit 844fd590e1
37 changed files with 1543 additions and 2 deletions

View File

@@ -0,0 +1,20 @@
import { redirect } from '@sveltejs/kit';
import type { Actions } from './$types';
import type { PageServerLoad } from './$types';
import { auth } from '$lib/server/auth';
export const load: PageServerLoad = async (event) => {
if (!event.locals.user) {
return redirect(302, '/demo/better-auth/login');
}
return { user: event.locals.user };
};
export const actions: Actions = {
signOut: async (event) => {
await auth.api.signOut({
headers: event.request.headers
});
return redirect(302, '/demo/better-auth/login');
}
};