Serenity icon indicating copy to clipboard operation
Serenity copied to clipboard

InvalidResetToken returns error

Open jgranade opened this issue 2 years ago • 1 comments

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)); }

jgranade avatar Aug 30 '21 16:08 jgranade

You can open a pull request to serene if you want AccountPage.cs

VictorTomaili avatar Nov 10 '21 08:11 VictorTomaili