Add magiclink Provider under Users & Permissions
#10746
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does it do?
This change adds a
magiclinkprovider under the Users & Permissions plugin.Why is it needed?
This allows Strapi to support authenticating a user coming in via a "Magic Link". The need for this change came about when I was using NextAuth and their
emailprovider (See NextAuth/email) which sends the user a magic link.I initially stumbled upon NextAuth through this tutorial (See Strapi Blog: User Authentication in NextJS with Strapi). It covers authenticating with social providers but not with the stock "magic-link" method, which necessitated this change.
How to test it?
To test this change, start Strapi as usual, and under
Settings > Users & Permissions > Providers, click onMagiclink, enable it and specify aClient IDwhich is equivalent to akey.Then to authenticate (and possibly register) a user, make a call to
/api/auth/magiclink/callback?email=<email>&access_token=<key>.Related issue(s)/PR(s)
N/A