Hey all, I'm a beginner to sst and trying to creat...
# help
h
Hey all, I'm a beginner to sst and trying to create a sign up/login page where user will only put their phone number, and they will get an otp , after providing the otp the user will be logged in (no need of email and pass). I'm following the serverless stack to build up the web app in the sst and there is only email and pass are mentioned. Can it be done with mobile number in sst itself ? Please help me to solve this. Thanks
t
To do passwordless auth with aws cognito you need to do a few funky things A collegue of mine wrote up a guide https://schof.co/cognito-magic-links/
f
Ah thanks @Thomas Ankcorn!
@manitej we can write up an example based on this post
t
That would be very cool to see, If you do tweet at https://twitter.com/tschoffelen because it would make his day
m
I'll remember this :))
h
@Thomas Ankcorn this seems cool, can it be done by using mobile number too ? The flow will be like, instead of email, user will add their Mobile Number, they will get an otp after submitting the otp, the Auth will be signed in.
t
yep you can send text messages with sns pretty easily, in a lot of countries it can be quite pricy compared to an email though which is something to keep an eye on
wait a second realised you don’t want a link you want a coder that the user will type in
there is a simpler solution to that specific flow
The one downside I would warn against of this approach vs the one in my colleagues article is the 3 minute timeout is not enough time for many users especially ones who are old or disabled
so if you go down the AWS route make sure you have some process to support those users logging in
h
@Thomas Ankcorn Yeah, I agree to the downside, but in my country, India people are quite familiar with OTP based authentication, most of the sign up including money transactions goes like this. So I feel this will be suitable for me. Thank you for the support.
t
thats really interesting to me, thanks for sharing! In the UK its not so common and our users (shopkeepers) are not that technology minded. Basically something to keep an eye out for, you could track number of failed sign ins or something where the code has expired