Hello,
Ive been trying to figure out the best solution to giving a user the option to request if they forgot their password by providing just a username within an ionic hybrid app without transitioning from the login-in page to an actually forgot password page.
Thank you
6 Answers, 1 is accepted
As I understand you would like the user to be able to reset his password by just entering his username in the mobile app. The reset password functionality normally requires administrator privileges but you can automate the process in the following way:
- The user enters his username and submits a "reset password" request, for example by clicking a button.
- The mobile app calls a cloud function and sends the username.
- The cloud function calls the "changepassword" endpoint of Backend Services, as described in more details here. At this point you also need to generate a new password.
- Once the password is changed, you could send an email to the user with his new password. This could be done from the same cloud function. More info about sending e-mails is available here.
Hope that helps.
Regards,
Alexander
Telerik

Hello alexander
im not trying to get the user to reset their password
I'm trying to get the user to have there password sent to their email if they forgot it
once they enter their username in the image shown all they have to do is press forgot password and a email will be sent.

Thanks for the clarification. I am afraid sending the current password is not possible because the user passwords are stored in a hashed form and cannot be decrypted. So the reset password approach is the only option in case of forgotten password.
I believe the steps from my previous post is what you need to implement. The handler of the "Forgot password?" button is where you should call the cloud function to reset the password (step 2).
Please get back to us if you need further assistance with the implementation.
Regards,
Alexander
Telerik

Alexander is there a way for you to show me an example on how I would go about doing this for an ionic hybrid app?
Hi Marcel,
There are two ways you could approach the forgotten password case:
- You can reset the password and set a new on yourself (as administrator) programmatically as described above by Alexander. This way you will generate a new password and the user will use the newly generated password to enter the app. Subsequently you may allow the user to supply a new password as explained here.
- You can send an email to the user to reset his password and the user will create a new one. I think you have already followed this approached based on this post.
Let me know if you need more help on this.
Regards,Martin
Telerik