mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-26 19:12:50 +00:00
Adds "Continue with Fayda" to the existing signup page. It is an alternative way to fill the form, not a second signup: the applicant still submits to /auth/signup-with-pwd through the same schema, the same validation and the same redirect to OTP verification, and signing up without Fayda is unchanged. The page asks the API for an authorization URL, keeps the returned handle and state in sessionStorage for the round trip, and FaydaCallbackPage hands the code back to /auth/fayda/callback. No Fayda protocol logic lives here — the PKCE verifier, the client key and the token exchange stay on the server. Once the account exists the page posts the verification token to /auth/fayda/link so the identity is recorded against it; that call is best-effort, since the account is already usable without it. Prefilled fields carry a "From Fayda" badge and stay editable, and a value that already belongs to another account is badged as such so the applicant can see which one to change rather than reading a single opaque signup error. Cancellation, an expired session, a mismatched state and an incomplete callback each get their own message. Amharic strings are a first pass and want a native speaker's review.