mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-12 23:33:43 +08:00
27 lines
645 B
TypeScript
27 lines
645 B
TypeScript
import { NextRequest } from 'next/server';
|
|
import {
|
|
createSessionStatusResponse,
|
|
logoutResponse,
|
|
ManagedAuthStorageError,
|
|
} from '@/lib/server/auth';
|
|
|
|
export const runtime = 'edge';
|
|
|
|
export async function GET(request: NextRequest) {
|
|
try {
|
|
return await createSessionStatusResponse(request);
|
|
} catch (error) {
|
|
if (error instanceof ManagedAuthStorageError) {
|
|
return Response.json(
|
|
{ authenticated: false, error: 'Managed authentication storage is unavailable' },
|
|
{ status: 503 },
|
|
);
|
|
}
|
|
throw error;
|
|
}
|
|
}
|
|
|
|
export async function DELETE(request: NextRequest) {
|
|
return logoutResponse(request);
|
|
}
|