feat: add TypeScript definitions for next-auth session with accessToken and user details
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-04 20:09:21 +02:00
parent afd2607000
commit ffe50e5151
135 changed files with 5 additions and 38 deletions
@@ -0,0 +1,15 @@
import { NextResponse } from 'next/server';
import { auth } from '../../../auth';
export async function GET() {
const session = await auth();
if ((session?.user as any)?.role !== 'admin') {
return NextResponse.json({ error: 'Forbidden' }, { status: 403 });
}
const key = process.env.MISTRAL_API_KEY ?? '';
const keyHint = key.length >= 4 ? key.slice(-4) : '????';
const hasKey = key.length > 0;
return NextResponse.json({ keyHint, hasKey });
}