Serenity
Serenity copied to clipboard
InvalidResetToken returns error
On Serenity 5.0.41, if the password reset link is invalid (i.e. expired) it throws this error:
An unhandled exception occurred while processing the request. InvalidOperationException: The model item passed into the ViewDataDictionary is of type 'System.String', but this ViewDataDictionary instance requires a model item of type 'Serenity.Services.ValidationError'.
My quick fix was to make this change in AccountPage.cs to send a ValidationError since that's what ValidationError.cshtml is expecting.
private ActionResult Error(string message) { //return View(MVC.Views.Errors.ValidationError, message); return View(MVC.Views.Errors.ValidationError, new ValidationError(message)); }
You can open a pull request to serene if you want AccountPage.cs