mirror of
https://github.com/open-reception/appointment-booking-software.git
synced 2026-09-13 04:37:39 +02:00
Fix failed login with access_token. Remove access_token when loading login route
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { fail } from "@sveltejs/kit";
|
||||
import { superValidate } from "sveltekit-superforms";
|
||||
import { zod4 as zod } from "sveltekit-superforms/adapters";
|
||||
import type { Actions } from "./$types";
|
||||
import type { Actions, PageServerLoad } from "./$types";
|
||||
import { formSchema } from "./schema";
|
||||
import type { WebAuthnCredential } from "$lib/server/auth/webauthn-service";
|
||||
import type { TUser } from "$lib/types/user";
|
||||
@@ -9,6 +9,16 @@ import logger from "$lib/logger";
|
||||
|
||||
const log = logger.setContext(import.meta.filename);
|
||||
|
||||
export const load: PageServerLoad = async (event) => {
|
||||
// Remove any existing access token cookie
|
||||
event.cookies.delete("access_token", {
|
||||
path: "/",
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
sameSite: "strict",
|
||||
});
|
||||
};
|
||||
|
||||
export const actions: Actions = {
|
||||
default: async (event) => {
|
||||
const form = await superValidate(event, zod(formSchema));
|
||||
|
||||
Reference in New Issue
Block a user