Commit graph

2 commits

Author SHA1 Message Date
Johannes Rauh
dd1f570629 Catch and surface exceptions from enroll() and unenroll()
Previously both methods were declared to throw only `ConfigurationError`
and callers did not catch it. This removes the now-overly-narrow
`@throws ConfigurationError` declarations and wraps both call sites in
`try/catch(Throwable)`, letting the enrollment form log the full
confidential trace and show the exception message inline rather than
leaving the user with an unhandled error page.

The enroll false path is also updated: `Notification::error()` is
replaced with `$this->onError()` to keep error feedback consistent with
the exception path.
2026-05-27 10:47:21 +02:00
Johannes Rauh
70ba207a34 Add TwoFactor interface
Defines the contract every 2FA implementation must satisfy:
`getName()` / `getDisplayName()` for identification, `isEnrolled()` to check
whether a user has a stored credential, `verify()` to validate a submitted
token, `enroll()` / `unenroll()` to persist or remove the credential, and
`assembleEnrollmentFormElements()` to contribute method-specific form fields
to the enrollment UI.
2026-05-26 14:36:51 +02:00