You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the flow diagram, I've attached, we should implement APIs for the Forget Password and Reset Password functionalities. This will allow users to recover their accounts by generating a One-Time Password (OTP) sent via email, verifying the OTP, and resetting their password.
Flow Overview:
Forget Password Flow:
Endpoint: POST /api/v1/auth/forget-password
Payload: { email }
Process:
Validate the request.
Verify if the email exists.
Generate an OTP and set an expiry time.
Save the OTP and send it via email to the user.
OTP Verification Flow:
Endpoint: POST /api/v1/otp/verify
Payload: { otp }
Process:
Verify the OTP.
If valid, generate a token for password reset.
Return the token to the user.
Reset Password Flow:
Endpoint: POST /api/v1/auth/reset-password
Payload: { password, confirmPassword, token }
Process:
Verify the token.
Validate password and confirmPassword.
Encrypt and store the new password.
Send a confirmation email that the password has been changed.
Notification Service Integration
The OTP and password reset emails will be sent through the Notification Service using:
Description:
According to the flow diagram, I've attached, we should implement APIs for the Forget Password and Reset Password functionalities. This will allow users to recover their accounts by generating a One-Time Password (OTP) sent via email, verifying the OTP, and resetting their password.
Flow Overview:
Forget Password Flow:
POST /api/v1/auth/forget-password
{ email }
OTP Verification Flow:
POST /api/v1/otp/verify
{ otp }
Reset Password Flow:
POST /api/v1/auth/reset-password
{ password, confirmPassword, token }
password
andconfirmPassword
.Notification Service Integration
Endpoint:
POST /api/v1/emails
Payload example:
Edge Cases:
Tasks:
forget-password
endpoints to handle the OTP generation process.otp/verify
endpoint to validate the OTP and generate a password reset token.reset-password
endpoint to handle the new password submission, validation, and storage.References
The text was updated successfully, but these errors were encountered: