Skip to content

Commit

Permalink
force document reload on logout
Browse files Browse the repository at this point in the history
  • Loading branch information
marekzelinka committed Sep 5, 2024
1 parent 9b99f49 commit a39619e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/utils/auth.server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Password, User } from '@prisma/client';
import { redirect } from '@remix-run/node';
import { redirect, redirectDocument } from '@remix-run/node';
import bcrypt from 'bcryptjs';
import { prisma } from './db.server';
import { authSessionStorage, getAuthSession } from './session.server';
Expand Down Expand Up @@ -129,7 +129,7 @@ export async function verifyLogin(
export async function logout(request: Request) {
const session = await getAuthSession(request);

return redirect('/', {
return redirectDocument('/', {
headers: {
'Set-Cookie': await authSessionStorage.destroySession(session),
},
Expand Down

0 comments on commit a39619e

Please sign in to comment.