How to configure password reminder & reset
The member registration site requires a reminder function to reissue the password when a user forgets the registered password.
The user can change the password by himself/herself from the URL of the password change page included in the email.
It also requires a function that the user can change his/her password by himself/herself.
This tutorial explains how to create an endpoint that performs password reminders and password resets.
Configure password reminder
If a user forgets their password, it can send a reminder email to reissue their password.
1. Create an endpoint for password reminder
Let's create an endpoint for the password reminder.
Select API you want to use and click [Add new endpoint].
This time, we create an endpoint as follows:
Field | Value | |
---|---|---|
Path | repass | |
Enabled/Disabled | Enabled | |
Model | Category | Authentication |
Model | Login | |
Operation | reminder | |
password_reset_page_url | /repass |
After completing the above, click [Add].
2. Send a password reminder E-mail
Next, let's check created endpoint using the SwaggerUI interface. Click [Swagger UI] on the API list page.
Click the endpoint you have just created.
Click [Try it out]
In the text area, enter the e-mail address which is registered on the site and click [Execute].
You can see that you are receiving response code 200.
You can see that the E-mail is also sent.
You will need a temporary password and token(after "?token=" in the URL) later for password reset so copy and save it.
If you enter an e-mail address that is not registered, you will get an error.
3. Reset password
Next, let's reset the password according to the sent email. Modify the request body of the same Swagger UI page as follows:
{
"token": "*****",
"temp_pwd": "*****",
"login_pwd": "*****"
}
Expression | Value |
---|---|
token | Token which you can find in your email (the string after "?token=") |
temp_pwd | temporary password which you can find in your email |
login_pwd | new password |
Click [Execute].
You can see that you are receiving response code 200.
Configuration of password reminder, confirmation on Swagger UI page, and password reset are now complete.
Configuration of a password reset
It is used when the user resets the password.
1. Create an endpoint for password reset**
Let's create an endpoint for a password reset.
Select API you want to use and click [Add new endpoint].
This time, we create an endpoint as follows:
Field | Value | |
---|---|---|
Path | password_reset | |
Enabled/Disabled | Enabled | |
Model | Category | Authentication |
Model | Login | |
Operation | reset_password |
After completing the above, click [Add].
2. Reset password
Next, let's reset the password using the endpoint which you just created. This time, we use Swagger UI.
Click [Swagger UI] on the API list page.
Click the endpoint you have just created.
Click [Try it out]
Enter below in the text area.
Expression | Value |
---|---|
login_id | user's e-mail address |
current_password | current password |
new_password | new password |
Click [Execute].
You can see that you are receiving response code 200.
If you enter an E-mail address that is not registered, an error is displayed.
Configuration of password reset and confirmation on the Swagger UI page are now complete.
Support
If you have any other questions, please contact us or check out Our Slack Community.