From d25e473eef86904fefc02c9d7a955b81a27b9635 Mon Sep 17 00:00:00 2001 From: Jessica Ho Date: Mon, 4 Sep 2023 07:49:12 +0000 Subject: [PATCH] don't cache magic link req --- src/routes/login/[phone]/[token]/+page.server.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/routes/login/[phone]/[token]/+page.server.ts b/src/routes/login/[phone]/[token]/+page.server.ts index 31177ac..df1404c 100644 --- a/src/routes/login/[phone]/[token]/+page.server.ts +++ b/src/routes/login/[phone]/[token]/+page.server.ts @@ -2,7 +2,7 @@ import type { PageServerLoad } from './$types'; import { redirect } from '@sveltejs/kit'; import prisma from '$lib/prisma'; -export const load = (async ({ params, cookies }) => { +export const load = (async ({ params, cookies, setHeaders }) => { console.log('LOAD LOGIN'); let magicLinkInfo; try { @@ -59,5 +59,9 @@ export const load = (async ({ params, cookies }) => { }); console.log('CREATED SESSION', session); + setHeaders({ + 'cache-control': 'no-store, max-age=0' + }); + throw redirect(308, '/dashboard'); }) satisfies PageServerLoad;