mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-05-31 17:53:59 +00:00
11 lines
360 B
TypeScript
11 lines
360 B
TypeScript
import { redirect } from 'react-router';
|
|
import { destroySession, getSession } from '../lib/auth.server';
|
|
import type { Route } from './+types/logout';
|
|
|
|
export async function loader({ request }: Route.LoaderArgs) {
|
|
const session = await getSession(request);
|
|
return redirect('/', {
|
|
headers: { 'Set-Cookie': await destroySession(session) },
|
|
});
|
|
}
|