···
email_verification_required: true,
verification_code_sent_at: sentAt,
const error = err as { message?: string };
if (error.message?.includes("UNIQUE constraint failed")) {
{ error: "Email already registered" },
console.error("[Auth] Registration error:", err);
···
updatePasskeyName(passkeyId, user.id, name);
-
return Response.json({ success: true });
···
const passkeyId = req.params.id;
deletePasskey(passkeyId, user.id);
-
return Response.json({ success: true });
···
// Verify the session belongs to the user
const targetSession = getSession(targetSessionId);
if (!targetSession || targetSession.user_id !== user.id) {
-
return Response.json({ error: "Session not found" }, { status: 404 });
deleteSession(targetSessionId);
-
return Response.json({ success: true });
···
if (rateLimitError) return rateLimitError;
await deleteUser(user.id);
-
"session=; HttpOnly; Secure; Path=/; Max-Age=0; SameSite=Lax",
···
{ error: "Email already in use" },
···
// Allow access if: owner, admin, or enrolled in the class
if (!isOwner && !isAdmin && !isClassMember) {
-
{ error: "Transcription not found" },
···
// Allow access if: owner, admin, or enrolled in the class
if (!isOwner && !isAdmin && !isClassMember) {
-
{ error: "Transcription not found" },
···
if (transcription.status !== "completed") {
{ error: "Transcription not completed yet" },
···
// Allow access if: owner, admin, or enrolled in the class
if (!isOwner && !isAdmin && !isClassMember) {
-
{ error: "Transcription not found" },
···
// Don't auto-start transcription - admin will select recordings
// whisperService.startTranscription(transcriptionId, filename);
-
message: "Upload successful",
return handleError(error);
···
const id = req.params.id;
-
return Response.json({ success: true });
return handleError(error);
···
const transcriptionId = req.params.id;
deleteTranscription(transcriptionId);
-
return Response.json({ success: true });
return handleError(error);
···
return Response.json({ error: "Invalid user ID" }, { status: 400 });
await deleteUser(userId);
-
return Response.json({ success: true });
return handleError(error);
···
const { passkeyId } = req.params;
deletePasskey(passkeyId, userId);
-
return Response.json({ success: true });
return handleError(error);
···
{ error: "Email already in use" },
···
deleteAllUserSessions(userId);
-
return Response.json({ success: true });
return handleError(error);
···
-
return Response.json({ success: true });
return handleError(error);
···
-
return Response.json(newClass);
return handleError(error);
···
return Response.json({ error: result.error }, { status: 400 });
-
return Response.json({ success: true });
return handleError(error);
···
-
return Response.json({ success: true, id });
return handleError(error);
···
-
return Response.json({ success: true });
return handleError(error);
···
toggleClassArchive(classId, archived);
-
return Response.json({ success: true });
return handleError(error);
···
enrollUserInClass(user.id, classId);
-
return Response.json({ success: true });
return handleError(error);
···
removeUserFromClass(userId, classId);
-
return Response.json({ success: true });
return handleError(error);
···
const meetingTime = createMeetingTime(classId, label);
-
return Response.json(meetingTime);
return handleError(error);
···
updateMeetingTime(meetingId, label);
-
return Response.json({ success: true });
return handleError(error);
···
deleteMeetingTime(meetingId);
-
return Response.json({ success: true });
return handleError(error);
···
-
return Response.json({ success: true });
return handleError(error);
···
email_verification_required: true,
verification_code_sent_at: sentAt,
const error = err as { message?: string };
if (error.message?.includes("UNIQUE constraint failed")) {
{ error: "Email already registered" },
console.error("[Auth] Registration error:", err);
···
updatePasskeyName(passkeyId, user.id, name);
+
return new Response(null, { status: 204 });
···
const passkeyId = req.params.id;
deletePasskey(passkeyId, user.id);
+
return new Response(null, { status: 204 });
···
// Verify the session belongs to the user
const targetSession = getSession(targetSessionId);
if (!targetSession || targetSession.user_id !== user.id) {
+
return Response.json({ error: "Forbidden" }, { status: 403 });
deleteSession(targetSessionId);
+
return new Response(null, { status: 204 });
···
if (rateLimitError) return rateLimitError;
await deleteUser(user.id);
+
return new Response(null, {
+
"session=; HttpOnly; Secure; Path=/; Max-Age=0; SameSite=Lax",
···
{ error: "Email already in use" },
···
// Allow access if: owner, admin, or enrolled in the class
if (!isOwner && !isAdmin && !isClassMember) {
+
{ error: "Forbidden" },
···
// Allow access if: owner, admin, or enrolled in the class
if (!isOwner && !isAdmin && !isClassMember) {
+
{ error: "Forbidden" },
···
if (transcription.status !== "completed") {
{ error: "Transcription not completed yet" },
···
// Allow access if: owner, admin, or enrolled in the class
if (!isOwner && !isAdmin && !isClassMember) {
+
{ error: "Forbidden" },
···
// Don't auto-start transcription - admin will select recordings
// whisperService.startTranscription(transcriptionId, filename);
+
message: "Upload successful",
return handleError(error);
···
const id = req.params.id;
+
return new Response(null, { status: 204 });
return handleError(error);
···
const transcriptionId = req.params.id;
deleteTranscription(transcriptionId);
+
return new Response(null, { status: 204 });
return handleError(error);
···
return Response.json({ error: "Invalid user ID" }, { status: 400 });
await deleteUser(userId);
+
return new Response(null, { status: 204 });
return handleError(error);
···
const { passkeyId } = req.params;
deletePasskey(passkeyId, userId);
+
return new Response(null, { status: 204 });
return handleError(error);
···
{ error: "Email already in use" },
···
deleteAllUserSessions(userId);
+
return new Response(null, { status: 204 });
return handleError(error);
···
+
return new Response(null, { status: 204 });
return handleError(error);
···
+
return Response.json(newClass, { status: 201 });
return handleError(error);
···
return Response.json({ error: result.error }, { status: 400 });
+
return new Response(null, { status: 204 });
return handleError(error);
···
+
return Response.json({ success: true, id }, { status: 201 });
return handleError(error);
···
+
return new Response(null, { status: 204 });
return handleError(error);
···
toggleClassArchive(classId, archived);
+
return new Response(null, { status: 204 });
return handleError(error);
···
enrollUserInClass(user.id, classId);
+
return new Response(null, { status: 201 });
return handleError(error);
···
removeUserFromClass(userId, classId);
+
return new Response(null, { status: 204 });
return handleError(error);
···
const meetingTime = createMeetingTime(classId, label);
+
return Response.json(meetingTime, { status: 201 });
return handleError(error);
···
updateMeetingTime(meetingId, label);
+
return new Response(null, { status: 204 });
return handleError(error);
···
deleteMeetingTime(meetingId);
+
return new Response(null, { status: 204 });
return handleError(error);
···
+
return new Response(null, { status: 204 });
return handleError(error);