fix: Update PrimeReact and fix all compilation errors
This commit is contained in:
0
app/api/auth/login/route.ts
Normal file → Executable file
0
app/api/auth/login/route.ts
Normal file → Executable file
0
app/api/auth/logout/route.ts
Normal file → Executable file
0
app/api/auth/logout/route.ts
Normal file → Executable file
25
app/api/auth/token/route.ts
Normal file → Executable file
25
app/api/auth/token/route.ts
Normal file → Executable file
@@ -5,9 +5,32 @@ import { NextRequest, NextResponse } from 'next/server';
|
||||
*/
|
||||
export async function POST(request: NextRequest) {
|
||||
try {
|
||||
console.log('📥 POST /api/auth/token - Requête reçue:', {
|
||||
method: request.method,
|
||||
url: request.url,
|
||||
headers: {
|
||||
'content-type': request.headers.get('content-type'),
|
||||
'content-length': request.headers.get('content-length'),
|
||||
}
|
||||
});
|
||||
|
||||
let body;
|
||||
try {
|
||||
body = await request.json();
|
||||
const rawBody = await request.text();
|
||||
console.log('📄 Corps brut de la requête:', {
|
||||
length: rawBody.length,
|
||||
preview: rawBody.substring(0, 100)
|
||||
});
|
||||
|
||||
if (!rawBody || rawBody.trim() === '') {
|
||||
console.error('❌ Corps de la requête vide');
|
||||
return NextResponse.json(
|
||||
{ error: 'Corps de la requête vide' },
|
||||
{ status: 400 }
|
||||
);
|
||||
}
|
||||
|
||||
body = JSON.parse(rawBody);
|
||||
} catch (jsonError) {
|
||||
console.error('❌ Erreur parsing JSON:', jsonError.message);
|
||||
return NextResponse.json(
|
||||
|
||||
Reference in New Issue
Block a user