Skip to content

Commit

Permalink
fix: logout user(last hope)
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed Dec 29, 2024
1 parent 8603e5d commit f76fd2a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/app/(api)/auth/logout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ import { NextResponse } from 'next/server';
export async function GET() {
const response = NextResponse.redirect(`${process.env.SITE_URL}`);

response.cookies.set('auth', '', {
path: '/',
expires: new Date(0),
domain: process.env.COOKIE_DOMAIN,
httpOnly: process.env.COOKIE_HTTP_ONLY === 'true',
});

response.cookies.set('auth', '', {
path: '/',
expires: new Date(0),
Expand Down

0 comments on commit f76fd2a

Please sign in to comment.