Forgot password link not working

If you think that something doesn't work in Aware IM post your message here
Post Reply
Maxo42
Posts: 46
Joined: Sun Dec 04, 2022 11:13 pm

Forgot password link not working

Post by Maxo42 »

How to make the Forgot Password link in Logon.jsp work. When I click on the link
Capture d’écran 2023-04-19 181619.png
Capture d’écran 2023-04-19 181619.png (12.35 KiB) Viewed 15632 times
I get these errors
Capture d’écran 2023-04-19 181649.png
Capture d’écran 2023-04-19 181649.png (58.4 KiB) Viewed 15632 times
Jaymer
Posts: 2430
Joined: Tue Jan 13, 2015 10:58 am
Location: Tampa, FL
Contact:

Re: Forgot password link not working

Post by Jaymer »

the error is exactly what it says.
you have to set a checkbox in a process.
reset.png
reset.png (36.81 KiB) Viewed 15629 times
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.

Jaymer
Aware Programming & Consulting - Tampa FL
Maxo42
Posts: 46
Joined: Sun Dec 04, 2022 11:13 pm

Re: Forgot password link not working

Post by Maxo42 »

Jaymer wrote: Wed Apr 19, 2023 10:24 pm the error is exactly what it says.
you have to set a checkbox in a process.
reset.png
I have no ResetPassword process.
I could create it but what is the line of code for the Action Rules of this process ?
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Forgot password link not working

Post by customaware »

ForgottenPassword process - Handles Forgotten Password Checked.

Rule 1:
ENTER NEW ForgottenPassword (is a Non Persisted BO called ForgottenPassword with Attributes....LoginName (50) and NewPassword (20) )
The Form only shows the LoginName

Rule 2:
IF NOT(EXISTS SystemUser WHERE (SystemUser.LoginName=ForgottenPassword.LogonName))
THEN REPORT ERROR 'There is no User with that Login Name.'
ELSE
FIND SystemUser WHERE SystemUser.LoginName=ForgottenPassword.LogonName
ForgottenPassword.NewPassword=GENERATE_PWD(8,10,1,1,1)
SystemUser.Password=ForgottenPassword.NewPassword
SEND ForgottenPasswordEmail TO SystemUser (Note.... You need to create a Notification Email here called ForgottenPasswordEmail )
DISPLAY MESSAGE 'Your new password has been sent to your email address'

Rule 3:
EXEC_SCRIPT `AwareApp.logout('`+ SystemSettings.BaseURL +`');` Where BaseURL is the Landing Page URL of your app.
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
PointsWell
Posts: 1457
Joined: Tue Jan 24, 2017 5:51 am
Location: 'Stralya

Re: Forgot password link not working

Post by PointsWell »

Thanks Mark, I've never applied the time to consider the workflow for this.

I'd add that best practice is not to say that the login / email cannot be found, but instead generally state if there's a matching email address then the new password will be sent - this prevents fishing for logins.
Maxo42
Posts: 46
Joined: Sun Dec 04, 2022 11:13 pm

Re: Forgot password link not working

Post by Maxo42 »

eagles9999 wrote: Fri Apr 21, 2023 1:08 am ForgottenPassword process - Handles Forgotten Password Checked.

Rule 1:
ENTER NEW ForgottenPassword (is a Non Persisted BO called ForgottenPassword with Attributes....LoginName (50) and NewPassword (20) )
The Form only shows the LoginName

Rule 2:
IF NOT(EXISTS SystemUser WHERE (SystemUser.LoginName=ForgottenPassword.LogonName))
THEN REPORT ERROR 'There is no User with that Login Name.'
ELSE
FIND SystemUser WHERE SystemUser.LoginName=ForgottenPassword.LogonName
ForgottenPassword.NewPassword=GENERATE_PWD(8,10,1,1,1)
SystemUser.Password=ForgottenPassword.NewPassword
SEND ForgottenPasswordEmail TO SystemUser (Note.... You need to create a Notification Email here called ForgottenPasswordEmail )
DISPLAY MESSAGE 'Your new password has been sent to your email address'

Rule 3:
EXEC_SCRIPT `AwareApp.logout('`+ SystemSettings.BaseURL +`');` Where BaseURL is the Landing Page URL of your app.
Unfortunately I did all the steps you described and I get this error when I click on the link Forgot Password
Capture d’écran 2023-04-26 151910.png
Capture d’écran 2023-04-26 151910.png (33.11 KiB) Viewed 15565 times
Maxo42
Posts: 46
Joined: Sun Dec 04, 2022 11:13 pm

Re: Forgot password link not working

Post by Maxo42 »

Now it works. Thank you eagle9999.

The only thing that must be added at the end of the code for the process is this line: SystemUser.EmailAddress = SystemUser.LoginName
so that the new password can be sent by email after having of course configured the BO SystemUser for it sends Email.

And don't forget either that the link Forgot password will only work when your application is in Current, because in Test it doesn't work.
customaware
Posts: 2391
Joined: Mon Jul 02, 2012 12:24 am
Location: Ulaanbaatar, Mongolia

Re: Forgot password link not working

Post by customaware »

Well done Max. Glad you got it working. 👍
Cheers,
Mark
_________________
AwareIM 6.0, 8.7, 8.8, 9.0 , MariaDB, Windows 10, Ubuntu Linux. Theme: Default, Browser: Arc
Upcloud, Obsidian....
Image
Post Reply