-
Notifications
You must be signed in to change notification settings - Fork 8
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
Clee/docs 240 #19
Clee/docs 240 #19
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Couple quick asks:
In order to send SMS messages, you must first add your credit card, this is to limit fraud/spam and in case there are incidental charges. |
src/components/Authenticate.tsx
Outdated
@@ -25,6 +25,8 @@ const Authenticate = () => { | |||
if (stytch && !user && isInitialized) { | |||
const token = searchParams.get("token"); | |||
const stytch_token_type = searchParams.get("stytch_token_type"); | |||
const code = searchParams.get("code"); |
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.
Is this code necessary?
An OTP flow (when using the pre-built UI) doesn't involve a redirect, and thus won't hit this route. The OTP code should be entered (and auth'd) all in the login component completely by the JS SDK.
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.
Ah you're right, I've looked through the JS SDK and see that we can grab the user input as part of the state to pass to the authenticate call. Updated!
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.
To put a finer point on it, no backend authenticate call is necessary for OTP when you're using our pre-built UI components. Unlike with EML or OAuth, no redirect happens as part of the authentication flow, so the user will never hit the redirect.
So for adding OTP to this app, all we'll need to do is the work in Login.tsx
, no other code changes should be necessary to get OTP up and running. Mind removing the changes here to Authenticate.tsx
and giving it a test?
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.
Oh woah magic! Okay just updated - appreciate the clarification.
Done! |
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.
Let's ship!
Add SMS OTP authentication to the demo app. Tested manually for all new and existing functionalities.