m ((username removed) (log details removed)) |
No edit summary |
||
Line 1: | Line 1: | ||
<message>Write the content here to display this box</message> | <message>Write the content here to display this box</message> | ||
There's no built-in password reset functionality in MDriven Turnkey. Add this pattern to your model that you can adapt as needed. | |||
If you use the default package for login, the [[Documentation:Customizing login and other account UI MVC|ASPNETIdentity]] package, this package will extend your model with the following: | If you use the default package for login, the [[Documentation:Customizing login and other account UI MVC|ASPNETIdentity]] package, this package will extend your model with the following: | ||
Line 11: | Line 11: | ||
#Make sure you have an email server set up. | #Make sure you have an email server set up. | ||
#Create an action that opens the "RestetPasswordPage" ViewModel. | #Create an action that opens the "RestetPasswordPage" ViewModel. | ||
== ResetPasswordTicket == | |||
=== Attributes === | |||
=== Methods === | |||
== SysUser == | |||
=== Methods === | |||
'''GetResetPasswordTicket: <code>ResetPasswordTicket</code>''' | |||
Triggers the ResetPasswordTicket State Machine to expire any password reset requests are past their expiry time. | |||
This method returns the user's '''ResetPasswordTicket''' that has been sent if any is available otherwise creates a new ResetPasswordTicket | |||
'''HashPassword: <code>String</code>''' | |||
Arg: pwd - password to hash | |||
This is used to hash a user's password | |||
'''SetPassword''' | |||
Arg: pwd - new password to set | |||
This is used to set a new PasswordHash for a user using the HashPassword method. | |||
Download the model file here: [[Model_Examples]] | Download the model file here: [[Model_Examples]] | ||
[[Category:Packages]] | [[Category:Packages]] | ||
{{Edited|July|12|2024}} | {{Edited|July|12|2024}} |
Revision as of 13:20, 11 December 2024
There's no built-in password reset functionality in MDriven Turnkey. Add this pattern to your model that you can adapt as needed.
If you use the default package for login, the ASPNETIdentity package, this package will extend your model with the following:
- A reset password page that you can create an action to go to. This page should not have any access groups.
- A server-side ViewModel that runs every 20 seconds and sends emails with reset instructions to your users. Remember to set the Turnkey/MDrivenServer's email server settings.
- A page for the user to set the password. This page also has information for the user about expired reset tickets and sending new tickets in those circumstances.
Import this template and then you:
- Set the PasswordReset package's "Default superclass" if you want that.
- Make sure you have an email server set up.
- Create an action that opens the "RestetPasswordPage" ViewModel.
ResetPasswordTicket
Attributes
Methods
SysUser
Methods
GetResetPasswordTicket: ResetPasswordTicket
Triggers the ResetPasswordTicket State Machine to expire any password reset requests are past their expiry time.
This method returns the user's ResetPasswordTicket that has been sent if any is available otherwise creates a new ResetPasswordTicket
HashPassword: String
Arg: pwd - password to hash
This is used to hash a user's password
SetPassword
Arg: pwd - new password to set
This is used to set a new PasswordHash for a user using the HashPassword method.
Download the model file here: Model_Examples