Files
taskarr-mgr/src/routes/auth/+page.server.ts
Milas Holsting 8e02f673ca
Some checks failed
Build and Push Container Image / build-and-push (push) Failing after 3m49s
work
2026-05-26 17:44:22 +02:00

21 lines
521 B
TypeScript

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 = (event) => {
if (!event.locals.user) {
throw redirect(302, '/auth/login');
}
return { user: event.locals.user };
};
export const actions: Actions = {
signOut: async (event) => {
await auth.api.signOut({
headers: event.request.headers
});
throw redirect(302, '/auth/login');
}
};