-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Add a URL/Webhook Provider #406
Comments
Thanks for raising this! Things are a little busy getting v3 in shape for release, but I would love to pick this one up when that is done. I had something like this in mind when working on the email verification so tried to keep the mechanism generic but I didn't give the actual flows much thought (beyond maybe assuming it might be useful to store different types of token). I wonder if adding some sort of callback to providers - or supporting the verification callback used in the email provider - in any provider might be good direction. I'd be interested in a PoC, but actually just a step by step walk through of what the functionality should be might be really helpful as might be able to take an approach that is as generic as possible so can work for other scenarios. I think using custom credentials (with a custom model) to trigger some sort of verification flow via a phone number shouldn't actually be technically difficult to get to if we can map out the flow! |
Yeah actually the email is just the exact same flow but with the Left a PR with tons of comments, excuse the messiness of prettier!, let's follow the discussion there |
Closing this issue as discussion has continued in #409. Feel free to reopen if anything new arises. |
Summary of proposed feature
This would be a similar strategy Email, the main difference would be that it let's you pick an attribute to identify your users and returns an valid URL to be able to continue the flow, how you send that URL to the user is 100% up to you.
Purpose of proposed feature
Main motivation for this is that I need to send Authentication links through a Message Provider and not via email, this entails a few things:
Webhook
than anythingcredentials
, noremail
, but thephoneNumber
of the user, which in this case is a custom attribute, not handled bynext-auth
but extended via models by me, and could be any other attribute if intendedemail
provider, as the primitive is just generating a URL based on aattribute
(email) andvalue
(user email)Detail about proposed feature
I have a very crude PoC running, but this follows 90% of the same flow as the
email provider
does, except it takes an attribute name and value instead of assuming email, you would use aattribute:value
format to store itPotential problems
I don't foresee any real issues other than quite a bit of code repetition as the flow is, as stated before, 90% like the email, this is definitely a solvable problem in the future as we could just migrate the
email provider
to use the more generic methods of theurl provider
in the future.Describe any alternatives you've considered
I don't see any alternatives as having an arbitrary unique identifier is currently not supported, as for the approach, I thought of naming it
webhook provider
but since the implementation after getting the URL could be anything, I opted forURL provider
, open to changing the name to whatever makes more sense.Obviously, happy to contribute the PR to this if it's something that sounds interesting for the project itself.
The text was updated successfully, but these errors were encountered: