Some checks failed
CI Pipeline / Code Quality & Typecheck (push) Waiting to run
CI Pipeline / Test Suite (macos-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (ubuntu-latest) (push) Blocked by required conditions
CI Pipeline / Test Suite (windows-latest) (push) Blocked by required conditions
CI Pipeline / Build Validation (admin) (push) Blocked by required conditions
CI Pipeline / Build Validation (desktop) (push) Blocked by required conditions
Deploy Landing Page / deploy (push) Blocked by required conditions
Deploy Landing Page / build (push) Waiting to run
Release & Packaging Pipeline / Build & Publish Admin Docker Image (push) Failing after 8s
Release & Code Signing CA Pipeline / build-and-sign-windows (push) Failing after 1m51s
Build macOS / Build & Package (macOS) (push) Failing after 4s
Build macOS / Build & Package (macOS)-1 (push) Failing after 5s
Release & Code Signing CA Pipeline / build-and-sign-macos (push) Failing after 3s
Release & Packaging Pipeline / Package macOS Desktop App (push) Failing after 4s
Release & Packaging Pipeline / Package Windows Desktop App (push) Failing after 2m28s
Release & Packaging Pipeline / Publish Official GitHub Release (push) Has been skipped
39 lines
956 B
TypeScript
39 lines
956 B
TypeScript
// apps/admin/src/app/api/auth/logout/route.ts
|
|
// D3RO Voice — Admin Session Logout Handler
|
|
|
|
import { NextResponse } from 'next/server'
|
|
|
|
export async function POST(): Promise<NextResponse> {
|
|
const response = NextResponse.json({ success: true, message: 'Logged out successfully' })
|
|
|
|
response.cookies.set({
|
|
name: 'd3ro_admin_session',
|
|
value: '',
|
|
httpOnly: true,
|
|
secure: process.env.NODE_ENV === 'production',
|
|
sameSite: 'lax',
|
|
path: '/',
|
|
maxAge: 0,
|
|
expires: new Date(0),
|
|
})
|
|
|
|
return response
|
|
}
|
|
|
|
export async function GET(request: Request): Promise<NextResponse> {
|
|
const url = new URL(request.url)
|
|
const response = NextResponse.redirect(new URL('/login', url.origin))
|
|
|
|
response.cookies.set({
|
|
name: 'd3ro_admin_session',
|
|
value: '',
|
|
httpOnly: true,
|
|
secure: process.env.NODE_ENV === 'production',
|
|
sameSite: 'lax',
|
|
path: '/',
|
|
maxAge: 0,
|
|
expires: new Date(0),
|
|
})
|
|
|
|
return response
|
|
}
|