Hi We are using Application template with Angular as frontend for our application.
in Case user forgets password and tries to reset by clicking on the email received. After user clicks the link is opened in new browser tab and then on other tab where forgotpassword page was opened he tries to resend email by clicking Resend button but its giving 400 error. Can you help us to gracefully show a message to the user like "Email already sent:".
Thanks
10 Answer(s)
-
0
hi
but its giving 400 error. Can you help us to gracefully show a message to the user like "Email already sent:".
Please share the full logs of backend, Thanks
liming.ma@volosoft.com
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Here are the logs https://easyupload.io/eya839
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
HTTP 400
This is an error coming from
Antiforgery token validation, We can't show"Email already sent:".to user.Antiforgery token validation failed. The antiforgery cookie token and request token do not match. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery cookie token and request token do not match. at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateTokens(HttpContext httpContext, AntiforgeryTokenSet antiforgeryTokenSet) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.ValidateRequestAsync(HttpContext httpContext) at Microsoft.AspNetCore.Mvc.ViewFeatures.Filters.ValidateAntiforgeryTokenAuthorizationFilter.OnAuthorizationAsync(AuthorizationFilterContext context)Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Can you help us in resolving this error? Any solution for this?
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
1
hi
You can override the
Account/ForgotPasswordand disable the csrf. But its not recommended,https://learn.microsoft.com/en-us/aspnet/core/security/anti-request-forgery?view=aspnetcore-7.0#override-global-or-controller-antiforgery-attributes
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi Maliming,
let me try your solution.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
how can we override antiforgery we don't have account/forgotpassword endpoint in api. Can you please share more details about it.
Also is there a way to handle 500 error gracefully on fogotpassword login page so that we redirect user to login page instead of displaying error message.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
It worked thank you
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)