Open fokosun opened 1 year ago
@captainPrime I'm working on the backend piece of this. I'll let you know when you can test and re open your draft pr https://github.com/mycookbook/web-client/pull/178
@captainPrime the backend piece is deployed to staging now. You can consume the endpoints to test locally then re open this PR for review
POST /api/v1/otp/generate
body {
'identifier': 'email or phone'
}
POST /api/v1/otp/validate
body {
'identifier': 'email or phone used to obtain token',
'token': {token}
}
On Success
{
"status": true,
"message": "OTP is valid"
}
Does not exist
{
"status": false,
"message": "OTP does not exist"
}
Not Valid*
{
"status": false,
"message": "OTP is not valid"
}
Expired
{
"status": false,
"message": "OTP Expired"
}
An OTP is a mechanism that will serve as an authentication mechanism for users without a session.
Task: In the report recipe page, consume the backend to generate an OTP for a user. The user is expected to get the code in their email or phone. The frontend should confirm this code by communicating with the backend. The user cannot proceed if the server does not respond with a 200.
Modify the form to accept email or phone number