Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built in OTP provider #8825

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

philbaker4
Copy link

@philbaker4 philbaker4 commented Oct 10, 2023

☕️ Reasoning

Building off of my thoughts in regards to #1465, I wanted to create a basic demo of what I had in mind. This PR is far from ready to be merged -- it's extremely ugly, incomplete, undocumented code, I know -- but hopefully highlights some level of the functionality that I am looking to enable.

As my ~proposed implementation comment notes, there are quite a few other things I would hope to support prior to merging (obviously in addition to docs, testing, cleanup, etc):

  • other built in (non-email OTP) send methods
    • e.g., pre-configured SMS providers, whatsapp support, etc. This could be shared with the current Email provider implementation that could be renamed something closer to MagicLink
  • user look up based on other OTP send methods in addition to email, involving updates to User model and adapters to fetch users by identifier type rather than email only (findUserByEmail)
  • improved OTP generation options in addition to fully custom override (e.g. length=6, type='alphanumeric')
  • rate limiting

Use apps/dev/otp-example to explore the functionality in its current state

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

Old, closed issue requesting the functionality built in.
Token provider that is somewhat different intended built-in functionality (IMO) but also addressing #1465

@vercel
Copy link

vercel bot commented Oct 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 10, 2023 1:00am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Oct 10, 2023 1:00am

@vercel
Copy link

vercel bot commented Oct 10, 2023

@philbaker4 is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

@barrynorman
Copy link

Hey there... Thanks for this.
What is the current status? Does this come soon?

@philbaker4
Copy link
Author

Hey there... Thanks for this. What is the current status? Does this come soon?

Havent really started a true implementation. Would be best to follow along in the RFC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants