Reset Password

You can reset the password of a registered user’s account using the following code snippet. While calling the reset_password() method, a reset password link will be generated and sent to the user’s email address. The authentication_service reference used in the below code snippet is the component instance created earlier. The email_id, platform_type, and zaid should be specified mandatorily.

Create a Dictionary

You will need to create a dictionary that contains the registration details of a particular user as given below. You can then pass the configured dictionary to the method that handles the password reset process.

    
copy
#Create a dictionary signupConfig = { "platform_type": 'web', 'zaid': '10014774358' } userConfig = { 'last_name': 'Burrows', 'email_id': 'amelia.burrows@zohocorp.com' };

Reset the Password

The objects that contains the user information and user signup configuration are passed as arguments to the reset_password() method which returns a response.

    
copy
#Reset user password response_data = authentication_service.reset_password(signup_config, user_details)

A sample response is shown below :

    
copy
"Reset link sent to amelia.burrows@zylker.com. Please check your email".