feat: frontend alumnos sam-pruebas (RUT+clave, rendir y mis resultados)

This commit is contained in:
Nurfog committed 2026-09-28 10:58:45 -03:00
commit e6d283e184
26 files changed
+2555

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import { NextResponse } from "next/server";
import { cookies } from "next/headers";
const COOKIE = "sam_pruebas_alumno";
/** Alumno conectado (según cookie de sesión). */
export async function GET() {
const jar = await cookies();
const raw = jar.get(COOKIE)?.value;
if (!raw) return NextResponse.json({ user: null }, { status: 401 });
try {
return NextResponse.json({ user: JSON.parse(decodeURIComponent(raw)) });
} catch {
return NextResponse.json({ user: null }, { status: 401 });
}
}