mirror of
https://github.com/pupperpowell/bibdle.git
synced 2026-04-05 17:33:31 -04:00
13 lines
356 B
TypeScript
13 lines
356 B
TypeScript
import { redirect } from '@sveltejs/kit';
|
|
import type { Actions } from './$types';
|
|
import * as auth from '$lib/server/auth';
|
|
|
|
export const actions: Actions = {
|
|
default: async ({ locals, cookies }) => {
|
|
if (locals.session) {
|
|
await auth.invalidateSession(locals.session.id);
|
|
}
|
|
auth.deleteSessionTokenCookie({ cookies });
|
|
redirect(302, '/');
|
|
}
|
|
}; |