caelum0x 2bcb0101ca feat(console): email code sign-in through Scribase Auth
The console could only sign in with Google or GitHub, so it could not open
before both OAuth apps exist (owner item Y-2). Add email sign-in: Scribase
Auth mails a one-time code (POST /otp), the console redeems it (POST /verify),
reads the user from the auth server, checks it matches the address, and opens
the same session as the OAuth path. Same-origin checks on both posts; inputs
validated before any call. RAILYARD_OAUTH_PROVIDERS picks the OAuth buttons
(default google,github; empty = email only). 7 new tests, console 154/154,
tsc clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 00:26:59 +03:00

10 lines
276 B
TypeScript

import { deps } from "../../../lib/deps.ts";
import { startEmailSignIn } from "../../../lib/email-signin.ts";
export const dynamic = "force-dynamic";
export async function POST(req: Request) {
const { cfg, repo } = deps();
return startEmailSignIn(req, { cfg, repo });
}