Planning for 1.0: Tokens #270
pilcrowonpaper
started this conversation in
General
Replies: 1 comment 1 reply
-
I really like the proposal. I thought about the same thing the last few days. We could also think about adding an interface to implement a verification service easily or adding an example of how to build one (e.g., email verification with nodemailer similar to how auth.js does it) to the docs/repo. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This feature will make it much easier to implement email verification, 2FA, and OTPs.
Summary
Provide APIs for generating and validating tokens. Tokens can be stored in any number of database tables. Tokens can hold any number of data, similar to
User
.(Please help me with the names).
Token types
Tokens can be either one time tokens or multi-use.
Access tokens
These token are user-context independent. Useful when you don't have the current session, like forgot-password email links.
Context tokens
These tokens use the user-context. Useful when you have the current session, like one time passwords.
Token validation
The validation process is:
one_time
is enabled, delete tokenConfigs
Tokens can be declared and configured inside
lucia()
.Database model
You can have any number of tables.
[token]
Beta Was this translation helpful? Give feedback.
All reactions