import { useState } from 'react' import { api } from './api' import styles from './Platform.module.css' // Phase 5A §6/§9 — self-service reset REQUEST. No email delivery exists yet // (docs/PHASE5A_STUDENT_IDENTITY_REMOTE_CLASSROOM.md §5) — this always shows the same generic // message regardless of whether the identifier exists (anti-enumeration, matches the server's // own response shape exactly). In dev/test, the server includes dev_reset_token in its // response so this screen can offer a direct link — a real deployment omits it, and completing // the flow needs an instructor to run the admin-side reset instead (see // docs/RUNBOOK_RESET_STUDENT_PASSWORD.md). export default function ForgotPasswordScreen({ onCancel, onHaveToken }) { const [identifier, setIdentifier] = useState('') const [sent, setSent] = useState(null) const [loading, setLoading] = useState(false) const submit = async (e) => { e.preventDefault() setLoading(true) try { const result = await api.requestPasswordReset(identifier) setSent(result) } finally { setLoading(false) } } return (
⎈ RootNode Academy

Reset your password

{!sent ? (
setIdentifier(e.target.value)} required />
) : ( <>

{sent.message}

{sent.dev_reset_token && (

Dev/test only (never shown in production):{' '}

)} )}

) }