Skip to content

Commit 2c2527b

Browse files
authored
Add basic docs for OTC-based flows (#9014)
Includes the changelog explanation for OTC
1 parent aa4eb0b commit 2c2527b

File tree

6 files changed

+268
-125
lines changed

6 files changed

+268
-125
lines changed

docs/reference/auth/email_password.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,19 @@ When a new user signs up, by default we require them to verify their email
351351
address before allowing the application to get an authentication token. To
352352
handle the verification flow, we implement an endpoint:
353353

354+
.. note::
355+
356+
If your Email/Password provider uses the **Code** verification method, the
357+
verification email contains a one-time code rather than a link. In that
358+
case, prompt the user for the code and call ``POST /verify`` with:
359+
360+
- **provider**: ``builtin::local_emailpassword``
361+
- **email** and **code**
362+
- optionally a **challenge** and **redirect_to** to receive a PKCE code or a redirect upon success
363+
364+
The Link-based example below continues to work when the provider uses the
365+
Link method.
366+
354367
.. note::
355368

356369
💡 If you would like to allow users to still log in, but offer limited access
@@ -511,6 +524,19 @@ one sends the reset email. The second is the HTML form that is rendered when
511524
the user follows the link in their email. And, the final one is the endpoint
512525
that updates the password and logs in the user.
513526
527+
.. note::
528+
529+
If your provider is configured for the **Code** method for password reset,
530+
the email will contain a one-time code instead of a reset link/token. In
531+
that case:
532+
533+
- Call ``POST /reset-password`` with **email**, **code**, **password** and
534+
optionally **challenge**.
535+
- If you include a **challenge**, the response will include a PKCE ``code``
536+
that you can exchange at ``POST /token`` to log the user in immediately.
537+
- If you omit **challenge**, the response will indicate success without a
538+
PKCE code and you should ask the user to sign in.
539+
514540
.. lint-off
515541
516542
.. code-block:: javascript

0 commit comments

Comments
 (0)