johnenrick / vergepos-api-gateway

API
https://api.vergepos.com
1 stars 0 forks source link

Forgot Password Page #128

Open johnenrick opened 4 years ago

johnenrick commented 4 years ago

Reminder

Before doing this task, be sure to update vergepos-api-gateway, db migrate, and php artisan db:seed --class=ServiceRestore

Description

File Location: @/views/PasswordReset.vue Link: /password-reset or click the forgot password in the log in page

The page has two phase, the Request Change Password and Confirm Change Password.

Request Change Password is where the user send a request to change the password by providing the email address of the account. The confirmation code will be sent through the email.

The Confirm Change Password, is where the user will enter the email(if not yet provided), confirmation code, and the new password.

Request Change Password

API for requesting: /user/request-change-password

When the user click the "Send Request" button, it will send a request using the API above. If successful, hide the Request Change Password Form and show the Confirm Change Password Form with prefilled up email.

Dont forget check for different errors in API.

Also provide the user an option to view the Confirm Change Password Form without having to send a request. This is for those who already made the request and has the code.

Confirm Change Password

API for confirming: confirm-change-password

There are two ways to get Confirm Change Password Form:

  1. Redirected after sending the request
  2. Clicking the "I have already a confirmation code" in the Request Form
  3. Clicking the link in the email. In this case, email and confirmation code should already been filled up using link parameters.

The API requires three parameters: email, confirmation code, and new password. If sucess, the data will be true.

There are at least 6 possible errors that can with the API. It should be dealt accordingly. These are:

  1. Validation Error
  2. Email and Confirmation Code Mismatched
  3. Confirmation Code has already expired
  4. The confirmation code has been invalidated. Usually happens if the user who receive the email clicked the "Its not me!" link in the email.
  5. The confirmation code has already been used to change the password
  6. System error. This should not happened not unless there is a problem in the system.

In detecting the error, compare using error code rather than the error message.

For error 3 and 4, the "Change Password" button should be hidden and "Send New Change Password Request" is shown.

For error code 5: The Change Password will be replaced with "Go to Log In Page" and "Send New Change Password Request" respectively.

For error code 6: hide the form, and show a message to contact the admin through facebook page about the error