mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-10-03 10:13:47 +10:00
Fix authentication recovery, account imports, application tracking, resume editing and exports, sharing, API contracts, provider selection, and private local attachments. Preserve authored content during PDF pagination. Update guides, generated OpenAPI output, and translation catalogs to match verified behavior and documented constraints. Validation: 1,019 tests passed; 12 database/OAuth integration tests skipped. Ten affected package typechecks, production build, Biome, and package boundaries passed.
16 lines
503 B
TypeScript
16 lines
503 B
TypeScript
import { resolveUserFromRequestHeaders } from "@reactive-resume/api/context";
|
|
|
|
export class AuthError extends Error {
|
|
constructor() {
|
|
super("Unauthorized");
|
|
}
|
|
}
|
|
|
|
export async function authenticateRequest(request: Request): Promise<void> {
|
|
// MCP accepts API keys and bearer tokens; share their priority and validation with its oRPC tools.
|
|
const headers = new Headers(request.headers);
|
|
headers.delete("cookie");
|
|
if (await resolveUserFromRequestHeaders(headers)) return;
|
|
throw new AuthError();
|
|
}
|