-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
feat: introducing magic.link provider (email based authentication) #124
Conversation
@drichar hey, let me know if there are any tweaks to address, ill merge latest from main and if you got some further comments can patch those up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for adding Magic Link support @aorumbayev! And I'm so sorry about the wait to get it reviewed.
I spun up the example in Storybook and it works flawlessly. 🚀
There are a few things to address in the code:
- Since the API key is a required option, the
ProviderDef
union type should be updated to enforce this. - The
provider.connect
function exposed in the public API by the useWallet hook shouldn't accept anonDisconnect
argument; it's used internally by the wallet clients'connect
method. See my comment for a detailed explanation.
Besides that, there are a few other very minor change requests.
Overall it works great and I love the implementation. If you're busy (and don't mind), I'd be happy to make these changes myself to get this merged and released ASAP. Let me know what you'd prefer.
Thanks again for this, and for all of your contributions to the library! ❤️
@aorumbayev Thank you for making these changes! Yeah I'm fine with updating the Babel config for Storybook... I did update and remove some dependencies in https://github.com/TxnLab/use-wallet/releases/tag/v2.5.0 that might be the reason Storybook worked for you before and then didn't. I've been thinking about the addition of the // something like:
if (typeof email !== 'string') {
throw new Error('Magic Link provider requires an email (string) to connect')
} Then if some future wallet provider needs to accept an argument to connect – say, an object – we won't be forced to either add a new optional argument or introduce a breaking change? Let me know what you think. Besides that, everything else looks great! |
Description
Checklist