AshAuthentication.Strategy.Otp.SignInPreparation
(ash_authentication v5.0.0-rc.7)
Copy Markdown
View Source
Prepare a query for OTP sign in.
This preparation:
- Filters the query by the identity field.
- After the query, computes the deterministic JTI from the submitted OTP code.
- Looks up the stored OTP token by JTI with a SELECT FOR UPDATE lock to prevent concurrent requests consuming the same code.
- If found and valid, optionally revokes it (single-use), generates an auth JWT,
and returns the user with the token in metadata. Otherwise returns an
AuthenticationFailederror so the audit log records the attempt as a failure.
Summary
Functions
Callback implementation for Ash.Resource.Preparation.init/1.
Callback implementation for Ash.Resource.Preparation.supports/1.
Functions
Callback implementation for Ash.Resource.Preparation.init/1.
Callback implementation for Ash.Resource.Preparation.supports/1.