Files
MineGeo/shared/legacy-recovery.ts

7 lines
313 B
TypeScript

// A previously issued recovery email can land at /code=<token> when its email
// template omitted the callback route. Bring that link through verification.
export function legacyRecoveryToken(pathname: string) {
const match = /^\/code=([A-Za-z0-9._~-]{8,2048})$/.exec(pathname);
return match?.[1] ?? null;
}