migrate auth v2 code

This commit is contained in:
JCEEE
2026-08-16 10:11:39 +01:00
parent 3dd94b8a7c
commit c73ced7894
45 changed files with 1965 additions and 1519 deletions
+11 -5
View File
@@ -1,14 +1,20 @@
import { redirect } from '@sveltejs/kit';
import { clearSession } from '$lib/server/auth';
import { clearSessionCookie } from '$lib/server/session';
function signOut(event: { cookies: any }) {
clearSessionCookie(event.cookies);
event.cookies.delete('session', { path: '/' });
event.cookies.delete('device_token', { path: '/' });
}
export function load(event) {
clearSession(event);
signOut(event);
throw redirect(303, '/');
}
export const actions = {
default: (event) => {
clearSession(event);
signOut(event);
throw redirect(303, '/');
},
};
}
};