wip
This commit is contained in:
11
apps/website/app/api/auth/logout/route.ts
Normal file
11
apps/website/app/api/auth/logout/route.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const authService = getAuthService();
|
||||
await authService.logout();
|
||||
|
||||
const url = new URL(request.url);
|
||||
const redirectUrl = new URL('/', url.origin);
|
||||
return NextResponse.redirect(redirectUrl);
|
||||
}
|
||||
11
apps/website/app/api/auth/session/route.ts
Normal file
11
apps/website/app/api/auth/session/route.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import { NextResponse } from 'next/server';
|
||||
import { getAuthService } from '@/lib/auth';
|
||||
|
||||
export async function GET() {
|
||||
const authService = getAuthService();
|
||||
const session = await authService.getCurrentSession();
|
||||
|
||||
return NextResponse.json({
|
||||
session,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user