I am trying to integrate SMS OTP based signup and login flow using AWS Cognito with an expressJS backend.
What I need is just following basic functionalities:
- After
/sendSMSAPI is called in express app, OTP should be sent to that phone number. - On
/verifySMSAPI, verification of phone number and OTP should happen and user should be created in userpool. - On
/resendSMSAPI, resend the OTP to that specific phone number.
I am able to send OTP to phone number using userPool.signUp method of npm package (https://www.npmjs.com/package/amazon-cognito-identity-js). But this only allows signing up and not login. Also, this is not possible without password.
How to implement above functionalities without password and also for login?
Any help is appreciated.