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
-
0
Here are the logs https://easyupload.io/eya839
-
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)
-
0
Can you help us in resolving this error? Any solution for this?
-
1
hi
You can override the
Account/ForgotPassword
and 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
-
0
hi Maliming,
let me try your solution.
Thanks
-
0
🙂
-
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.
-
-1
hi
https://support.abp.io/QA/Questions/160/How-to-customize-an-ABP-project
-
0
It worked thank you