Skip to content

Commit

Permalink
Make logout endpoint unauthenticated
Browse files Browse the repository at this point in the history
This prevents us using /logout as a returnTo URL
  • Loading branch information
myieye committed Nov 21, 2024
1 parent 5442b7e commit b8dade4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 0 additions & 9 deletions frontend/src/routes/(authenticated)/logout/+server.ts

This file was deleted.

9 changes: 9 additions & 0 deletions frontend/src/routes/(unauthenticated)/logout/+server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import type {RequestEvent} from './$types';
import {logout} from '$lib/user';
import {redirect} from '@sveltejs/kit';

export function GET({cookies}: RequestEvent): void {
logout(cookies);

redirect(303, '/login');
}

0 comments on commit b8dade4

Please sign in to comment.