Skip to content

Commit

Permalink
feat(auth): sign-out route
Browse files Browse the repository at this point in the history
  • Loading branch information
altaywtf committed Dec 13, 2023
1 parent 8487828 commit e52489b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/(auth)/auth/sign-out/route.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import type { NextRequest } from 'next/server';

import { createSupabaseServerClient } from '@/lib/services/supabase/server';
import { cookies } from 'next/headers';
import { NextResponse } from 'next/server';

export async function POST(request: NextRequest) {
const supabase = createSupabaseServerClient(cookies());
await supabase.auth.signOut();

return NextResponse.redirect(new URL('/', request.url).toString(), {
status: 301,
});
}

0 comments on commit e52489b

Please sign in to comment.