Skip to content

feat: Add passwordless OTP login to the email identity provider - #5869

Merged
marcelomendoncasoares merged 35 commits into
serverpod:mainfrom
SandPod:SandPod/add-email-and-random-number-authentication
Oct 22, 2026
Merged

marcelomendoncasoares merged 35 commits into
serverpod:mainfrom
SandPod:SandPod/add-email-and-random-number-authentication

Conversation

@SandPod

@SandPod SandPod commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Adds passwordless login with a one-time password (OTP) sent by email to the existing email identity provider. Servers opt in by extending the new EmailOtpIdpBaseEndpoint instead of EmailIdpBaseEndpoint. SignInWidget detects that endpoint and shows the new EmailOtpSignInWidget. The existing password flow, EmailIdpBaseEndpoint, EmailSignInWidget and EmailAuthController keep working as before, so this can ship in a minor version.

New projects created from the template use the OTP flow by default. OTP proves ownership of the email on every sign-in, and anyone with access to the inbox could reset the password anyway. Existing apps keep the password flow until their server endpoint extends EmailOtpIdpBaseEndpoint.

Fixes #2100

Important

Opinions wanted: OTP codes fall back to the registration sender.
To upgrade, an app should only need to extend EmailOtpIdpBaseEndpoint, regenerate and migrate. Apps with custom email senders don't have the new EmailIdpConfig.sendOtpLoginVerificationCode yet. So when it is not set, the codes are sent with the app's existing sendRegistrationVerificationCode, passing the OTP login request ID as its accountRequestId, and a warning is logged on first use. If neither sender is set, requesting a code fails with a StateError.

  • Why a fallback: the alternatives fail at runtime, on the first code request, or at server startup. Neither is caught by static analysis, so a broken configuration could be deployed, e.g. to Serverpod Cloud, before anyone notices. With the fallback, upgrading works without config changes for apps whose registration emails only contain the code.
  • Known limitations:
    • Registration emails that build links from accountRequestId, e.g. to complete a registration, get links that don't work for a login request.
    • Users signing in to an existing account receive the app's registration-style email.
    • Both go away once the app sets its own sendOtpLoginVerificationCode. ServerpodCloudEmailIdpConfig, used by new projects, already does.
  • Alternatives considered:
    • Fail at runtime or at server startup when the OTP sender is missing.
    • A one-line adapter that turns the registration sender into an OTP sender, which developers add consciously.

How it works

  1. The user enters their email and requests a code. Apps can also let users expand a password field and sign in with their password, with allowPasswordSignIn: true on EmailOtpSignInWidget or EmailOtpAuthController. It defaults to false.
  2. The user enters the code. It is 6 digits by default (defaultOtpVerificationCodeGenerator). To change it, set EmailIdpConfig.otpLoginVerificationCodeGenerator on the server and otpVerificationCodeConfig on EmailOtpSignInWidget (see the decision on the code length below). Verification follows the existing secret challenge pattern and returns a completion token.
  3. If an account exists, the user is signed in (finishOtpLogin). Otherwise the user accepts the terms and, if the server allows it, can expand an optional password field before the account is created (finishOtpRegistration). The server setting is EmailIdpConfig.allowPasswordOnOtpRegistration, which defaults to false, and it is returned with the verification result.

Tokens and sessions created through OTP use the same email method (EmailIdp.method) as password logins, since both authenticate the same EmailAccount through the same identity provider. A password reset therefore revokes them as before. Recording how a session was authenticated, e.g. to audit whether an account was accessed through its password or the inbox, is left for a follow-up as session metadata in core.

Decision: the code length is not sent by the server

The server and the client configure the code independently, the same way as the existing registration and password reset codes, so both have to be changed together. Sending the length with each code request was tried and dropped: the client would still need the allowed characters and other input settings from its own configuration, so the server can't take over the configuration, and keeping the existing pattern is simpler. The serverpod-auth skill and the doc comments point out that both sides must match.

Server

  • New EmailAccountOtpLoginRequest table.
  • New abstract EmailOtpIdpBaseEndpoint, extending EmailIdpBaseEndpoint, with startOtpLogin, verifyOtpLoginCode, finishOtpLogin and finishOtpRegistration. EmailIdpBaseEndpoint and its generated client class are unchanged.
  • New EmailIdpConfig options:
    • the code generator (6 digits by default)
    • code lifetime (15 minutes) and verification attempts per code (3)
    • code request rate limit (5 per 15 minutes per email)
    • the sendOtpLoginVerificationCode callback, falling back to sendRegistrationVerificationCode (see the highlighted question above)
    • whether a password may be set on registration, allowPasswordOnOtpRegistration, which defaults to false
  • defaultVerificationCodeGenerator gains an optional length parameter. It still defaults to 8, so registration and password reset codes are unchanged.
  • A successful OTP sign-in or account creation clears the code requests logged for the email, like a successful password login clears its failed attempts. Without this, users signing in several times within 15 minutes were locked out. Codes requested by others still count, since only the owner of the email can complete a request.
  • Code requests do not reveal whether an email is registered. Errors reuse EmailAccountRequestException, and the user facing messages for those errors are now worded neutrally, without mentioning registration.
  • The three copies of the secret challenge exception mapping in the email utils are replaced by a shared helper.
  • ServerpodCloudEmailIdpConfig sends the codes with the existing signup email type. The Cloud email client itself is unchanged.

Flutter

  • Detection: SignInWidget shows EmailOtpSignInWidget, with its own client and callbacks, when the server exposes an endpoint extending EmailOtpIdpBaseEndpoint, and EmailSignInWidget otherwise. client.auth.idp.hasEmailOtp exposes the detection. A customized widget can still be passed as emailSignInWidget or emailOtpSignInWidget.
  • New widget: EmailOtpSignInWidget and its EmailOtpAuthController form a separate widget branch next to EmailSignInWidget.
    • Like the other sign-in widgets, the OTP widget takes either a controller or a client.
    • Password sign-in in the OTP flow is enabled with allowPasswordSignIn, on the widget or the controller. It defaults to false.
    • The default email validation of both email flows now accepts email aliases (e.g. [email protected]), which are commonly used to test a deployed app with several accounts on one inbox. Pass a custom emailValidation to reject them, e.g. with validateEmail(email, allowEmailAliases: false).
  • Shared code: both controllers build on a new EmailFlowController base holding the shared state and requests. The forms both flows use (verification, password reset, email field) are shared widgets, which the existing public forms delegate to with unchanged interfaces.
    • EmailFlowScreen, EmailSignInWidget and the public API of EmailAuthController are unchanged.
    • The goal is to remove the password-only branch in a future major version and keep the OTP one, which covers both sign-in methods.
  • OTP screens:
    • Like the password screens, the OTP screens use FormStandardLayout, so the title and the action button stay at the same positions through the flow. Content that does not fit, e.g. on narrow screens or with the password requirements expanded, scrolls instead of overflowing.
    • Choosing to sign in with a password expands the password field with the same spacing as the password login, and the button then reads "Sign in".
    • On the create account screen, the optional password is hidden until the user chooses to add one.
  • Retry: if completing the sign-in fails after the code was verified, e.g. on a network error, it can be retried without re-verifying the already used code. If the server no longer accepts it, the controller throws OtpLoginRejectedException, which convertToUserFacingException turns into a message asking for a new code.
  • Texts: the OTP texts are set through SignInLocalizationProvider(emailWithOtp: EmailWithOtpSignInTexts.defaults.copyWith(...)), next to the texts of the other widgets. Like the other *Texts classes, all of its texts are required, with the English ones in defaults. The screens shared with the password flow use EmailSignInTexts, which is unchanged. ResendCodeButton gains an optional label, defaulting to its previously hard-coded text, which the OTP flow sets from EmailWithOtpSignInTexts.resendCode.
  • Docs and examples: the auth example and the project template servers extend EmailOtpIdpBaseEndpoint, so their apps show the OTP widget without changes. The auth example also enables the password sign-in and passwords on account creation, to showcase the full flow. The serverpod-auth skill documents the setup.
  • Fixes in shared code:
    • Disposing an email controller shortly after typing an email no longer makes its pending email validation notify a disposed controller.
    • When the app is resumed, the verification code input fills in a code from the clipboard and submits it. The code of a previous sign-in, still in the clipboard, was therefore submitted right away and counted as a failed attempt. Codes already completed in the app are now skipped. This applies to both email widgets.
  • Storybook: the email stories are grouped under Email:
    • Email/OTP and Password has every screen of the new widget.
    • Email/Password Only has the existing password screens.

Commits

The history was rebuilt on the latest main as if the final design had been written at once, without separate commits for fixes made during the review. The commits are meant to be reviewed one at a time:

  1. Server: a shared exception mapping, the 6 digit code generator, the passwordless login in EmailIdp, EmailOtpIdpBaseEndpoint and the Serverpod Cloud sender.
  2. Flutter: the EmailFlowController and shared forms refactors, which keep the password flow unchanged, the localizable resend text, EmailOtpSignInWidget, the SignInWidget detection, the clipboard fix (a bug that also exists on main) and the storybook stories.
  3. The project template, the auth example and the serverpod-auth skill.
  4. Commits marked (review) address review comments, so they can be checked against the comment they answer:
    • test: Cover finishing a passwordless login that expired after verification (review)
    • feat: Accept email aliases in the default email validation (review)
    • Marcello's review: the required OTP texts, the removed account creation intro, the formal verification message, the resend text through the OTP texts only, the removed implementation detail tests, the SignInWidget test structure, the stable layout, the email token method (with its generated code), the rejection of concurrent completions and the notes on the example senders.

Generated code (chore: Generate code ...) and migrations (chore: Add migrations ...) are in separate commits with no manual changes, so the server commits before the generated code commit don't compile on their own.

Known limitations / follow-ups

  • Cloud email wording: the hosted email service's sign-up template currently reads "complete your sign-up". It will be made generic enough for signing in as well, in the Serverpod Cloud email service.
  • Terms acceptance: it is enforced by the UI but not recorded on the server.
  • Earlier draft: this supersedes the earlier draft feat: Add passwordless login to the email identity provider #5828, which used a different design.

Pre-launch Checklist

  • I read the Contribute page and followed the process outlined there for submitting PRs.
  • This update contains only one single feature or bug fix and nothing else. (If you are submitting multiple fixes, please make multiple PRs.)
  • I read and followed the Dart Style Guide and formatted the code with dart format.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///), and made sure that the documentation follows the same style as other Serverpod documentation. I checked spelling and grammar.
  • I added new tests to check the change I am making.
  • All existing and new tests are passing.
  • Any breaking changes are documented below.

Breaking changes

None for existing code. Some changes to be aware of:

  • EmailAuthController now extends the new EmailFlowController instead of ChangeNotifier directly. Its public API is unchanged; it gains a few @protected members used by the base class.
  • New behavior: the default email validation of EmailSignInWidget and EmailAuthController accepts email aliases. EmailAuthController.validateEmail and EmailFlowController.validateEmail now default allowEmailAliases to true; apps that relied on rejecting aliases pass allowEmailAliases: false in a custom emailValidation.

🤖 Generated with Claude Code

@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch from 20822a0 to 91f602f Compare October 15, 2026 17:38
@SandPod
SandPod marked this pull request as draft October 15, 2026 17:47
@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch from 91f602f to ffc556c Compare October 15, 2026 17:57
@SandPod
SandPod marked this pull request as ready for review October 15, 2026 18:14
@SandPod
SandPod requested a review from a team October 15, 2026 18:15
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@cursor

cursor Bot commented Oct 16, 2026

Copy link
Copy Markdown

I have read the CLA Document and I hereby sign the CLA

@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch from 567a227 to e3fcfef Compare October 16, 2026 09:34
@cursor

cursor Bot commented Oct 16, 2026

Copy link
Copy Markdown

I have read the CLA Document and I hereby sign the CLA

@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch 2 times, most recently from 40350a4 to b8d1aff Compare October 16, 2026 20:15
@SandPod
SandPod requested a review from FXschwartz October 16, 2026 20:37
SandPod and others added 2 commits October 20, 2026 13:13
…tils

Move the mapping from `SecretChallengeException` to the email account
request and password reset exceptions into a shared helper, so that the
passwordless login can reuse the email account request mapping.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`defaultVerificationCodeGenerator` gains an optional `length`, still
defaulting to 8, so registration and password reset codes are unchanged.
`defaultOtpVerificationCodeGenerator` returns 6 digit codes for the
passwordless login.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch from b8d1aff to 2602f08 Compare October 20, 2026 11:19
SandPod and others added 13 commits October 20, 2026 13:26
… provider

Users request a one-time password for their email, verify it, and are
then signed in, or create an account if none exists for the email. The
flow reuses the secret challenge pattern of registrations and password
resets, and is exposed through `EmailIdp.startOtpLogin`,
`verifyOtpLoginCode`, `finishOtpLogin` and `finishOtpRegistration`.

- `EmailAccountOtpLoginRequest` stores the pending logins, and
  `EmailAccountOtpVerificationResult` tells the client whether an account
  exists and whether a password may be set on account creation.
- Tokens issued by the passwordless login use the `email_otp` method
  (`EmailIdp.otpMethod`), so they can be told apart from password logins.
- `EmailIdpConfig` gains the code generator (6 digits by default),
  lifetime (15 minutes), allowed attempts per code (3), rate limit on
  requested codes (5 per 15 minutes), sender and
  `allowPasswordOnOtpRegistration` (defaults to `false`).
- Without `sendOtpLoginVerificationCode`, codes are sent with
  `sendRegistrationVerificationCode` and a warning is logged once.
  Starting a login fails with a `StateError` if neither sender is set.
- Completing a login or an account creation clears the code requests
  logged for the email, like a successful password login clears its
  failed attempts, so users signing in repeatedly are not locked out.
  Codes requested by others still count, since only the owner of the
  email can complete a request.
- The admin can delete expired login requests and logged code requests.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The endpoint extends `EmailIdpBaseEndpoint` with `startOtpLogin`,
`verifyOtpLoginCode`, `finishOtpLogin` and `finishOtpRegistration`, so
servers opt in to the passwordless login by extending it instead of
`EmailIdpBaseEndpoint`. The password based endpoint is unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`ServerpodCloudEmailIdpConfig` sets `sendOtpLoginVerificationCode`,
sending the codes with the sign-up email type.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Generated by `serverpod generate` for the new models and
`EmailOtpIdpBaseEndpoint`, without manual changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ontroller`

Move the state, text inputs and requests the email flows have in common,
such as the password login, the password reset and the guarded request
handling, into the abstract `EmailFlowController`, parameterized by the
screens of a flow. `EmailAuthController` extends it without changes to
its public interface or behavior, so a passwordless flow can reuse the
shared parts without depending on the password based flow.

`dispose` now also cancels the debounce timer of the email validation.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Move the verification, password reset, set password, email field and back
to sign-in forms into internal shared forms working with any
`EmailFlowController`. The public forms keep their signatures and wrap
the shared ones.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
`EmailSignInTexts` gains `resendCode`, read by `ResendCodeButton` from the
localization provider instead of a hard-coded English text. It defaults
to the previous text.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Users enter their email and receive a one-time password. Verifying it
signs in existing accounts, while emails without an account continue to
a screen to accept the terms and create one, with an optional password
if the server allows it. Apps can also let users sign in with their
password, and reset it, from the start screen with `allowPasswordSignIn`
on the widget or `EmailOtpAuthController`, defaulting to `false`.

- `EmailOtpAuthController` is a standalone controller on top of
  `EmailFlowController`, independent of the password based
  `EmailAuthController`. It requires a server endpoint extending
  `EmailOtpIdpBaseEndpoint`. Its default email validation accepts email
  aliases.
- If completing the sign-in fails, verifying again retries the completion
  without the used code, and asks for a new code once the server rejects
  it (`OtpLoginRejectedException`).
- `EmailWithOtpSignInTexts` holds the texts of the flow, set through
  `SignInLocalizationProvider.emailWithOtp`.
- The forms of the flow place the action right below their content and
  grow with it, so expanding fields, wrapped texts and narrow layouts do
  not overflow. The password field on the start screen expands in place,
  and the action button cross-fades its label.
- The email account request errors no longer mention registrations,
  since the passwordless sign-in raises them too.

Co-authored-by: Cursor Agent <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…lable

`SignInWidget` shows `EmailOtpSignInWidget` when the server exposes an
endpoint extending `EmailOtpIdpBaseEndpoint`, detected with the new
`hasEmailOtp` of the client's identity providers, and
`EmailSignInWidget` otherwise. Upgrading a server endpoint is all it
takes to switch an app to the passwordless flow. Pass
`emailOtpSignInWidget` to customize the widget.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
When the app is resumed, the verification code input fills in a code of
the right length from the clipboard, which completes it right away. The
code of a previous sign-in, still in the clipboard, was therefore
submitted as soon as the user returned to the app, and counted as a
failed attempt. Codes completed in any verification code input of the
app are now skipped.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The email stories are grouped into `Email/OTP and Password` for the
passwordless flow and `Email/Password Only` for the password based flow,
backed by an in-memory mock of both email endpoints.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The `EmailIdpEndpoint` of the project template extends
`EmailOtpIdpBaseEndpoint`, so new projects offer the passwordless
sign-in, with the password sign-in still available.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The example server extends `EmailOtpIdpBaseEndpoint` and logs the
one-time passwords, and the example app customizes the texts of the
passwordless flow.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SandPod and others added 4 commits October 20, 2026 13:26
…kill

The code length is not sent to the client, so the skill explains that the
server's `otpLoginVerificationCodeGenerator` and the widget's
`otpVerificationCodeConfig` must be changed together. Both default to
6 digits.

Co-authored-by: Cursor Agent <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Generated by `serverpod generate` after extending `EmailOtpIdpBaseEndpoint`
in the example server, without manual changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Created by `serverpod create-migration` for the
`serverpod_auth_idp_email_account_otp_login_request` table, in the
auth module, the projects depending on it and the auth example, without
manual changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ation (review)

The completion of a passwordless login has its own expiry check, but no
test covered `finishOtpLogin` or `finishOtpRegistration` on a request
that expired after its code was verified, unlike the registration and
password reset flows. Both now throw `EmailAccountRequestException` with
reason `expired`, delete the request and, for the registration, do not
create an account.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch from 2602f08 to 3479410 Compare October 20, 2026 11:27
The default validation of both email flows now accepts email aliases,
e.g. [email protected], instead of only the passwordless flow.
Aliases are commonly used, e.g. to test a deployed app with several
accounts on one inbox, and rejecting them is not needed for a secure
sign-in. `EmailFlowController.validateEmail` and
`EmailAuthController.validateEmail` now default `allowEmailAliases` to
`true`, so `EmailOtpAuthController` no longer overrides the validation.
Apps can still reject aliases with a custom `emailValidation`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>

@FXschwartz FXschwartz left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🚀

@marcelomendoncasoares marcelomendoncasoares left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implementation looks very solid! Found only one small bug on the workflow that is throwing the wrong exception. Most of my comments are around UX, consistency with the IDP contract, and integration with the existing EmailIdp.

On the Flutter side, my main concern is that, although the components are shared, they’re wrapped in separate screen implementations with different spacing and layouts. We will end up maintaining two versions of very similar screens, and the new flow loses some UX consistency. I'd favor a bit more reuse of the existing code and keep the differences limited to the OTP flow needs if possible.

SandPod and others added 12 commits October 21, 2026 22:12
Like the other `*Texts` classes, the constructor requires every text, so
apps localizing the passwordless flow can not miss one. The English texts
move to `EmailWithOtpSignInTexts.defaults`, and partial overrides use
`copyWith`.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…(review)

The title, terms checkbox and action already explain the screen, which
now matches the password based registration and has one less text to
localize.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…ssage (review)

The default verification message of the passwordless flow now uses the
same wording as the password based flow.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…y (review)

`EmailSignInTexts` is back to its interface on `main`, so the password
based flow is unchanged. `ResendCodeButton` takes an optional `label`,
defaulting to the text it had hard-coded, now exposed as
`ResendCodeButton.defaultLabel`. The passwordless flow passes
`EmailWithOtpSignInTexts.resendCode` on its verification screens, whose
default refers to that constant, so the English text is defined once.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… flow (review)

The test checking the controller's type hierarchy and the assertion on the
gap below the email field only pinned implementation details, not
behavior.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The scenarios of the `SignInWidget` detection tests were split between the
group and the "when" of each test. Each test now states its own given.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rdless flow (review)

The passwordless screens use `FormStandardLayout` like the password based
screens, so the title and the action button stay at the same positions
while proceeding through the flow, and the password sign-in matches the
spacing of the password login. Content that does not fit the form, e.g.
on narrow screens or with the password requirements expanded, scrolls
instead of overflowing. `FormInlineActionLayout` is removed.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Tokens from passwordless logins used a separate `email_otp` method, which
overloaded the identity provider's method as token metadata: it was not
reserved by the provider registration, and code listing or revoking tokens
by `EmailIdp.method` missed these sessions. Both ways of signing in now
issue tokens with `EmailIdp.method`, so the password reset revokes them
with its single revocation as before.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…iew)

Generated by `serverpod generate` for the updated doc comments of
`EmailOtpIdpBaseEndpoint`, without manual changes.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
… (review)

Two concurrent `finishOtpLogin` or `finishOtpRegistration` calls with the
same token both passed the completion challenge. The second then failed
deleting the already deleted request with a `DatabaseUnexpectedResultException`
instead of the expected `invalid` reason. The request is now deleted with a
check of the deleted rows, which throws `EmailAccountRequestNotFoundException`
for the losing call, so it reports `invalid` while still completing a
single login per verified code.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The password reset sender is only needed when users can sign in with a
password, and the registration sender serves the password based
registration and the fallback for one-time passwords.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…e (review)

The example app enables the password sign-in of `EmailOtpSignInWidget`,
and the example server lets users set a password when creating an
account. The comments on the email senders now describe when the
passwordless setup uses each of them.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@SandPod
SandPod force-pushed the SandPod/add-email-and-random-number-authentication branch from 0307fc9 to 2b6154d Compare October 21, 2026 20:26

@marcelomendoncasoares marcelomendoncasoares left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 📧

@marcelomendoncasoares
marcelomendoncasoares merged commit f2df184 into serverpod:main Oct 22, 2026
481 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 22, 2026
@SandPod
SandPod deleted the SandPod/add-email-and-random-number-authentication branch October 22, 2026 06:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add email and random number authentication

3 participants