Replies: 1 comment 1 reply
-
The anti forgery validation used the current user's id as part of the validation. Since the request is no longer authenticated, but the anti forgery token is based on the user id of who was logged in, it fails. This is hard to support if the design of anti forgery necessitates using the user id as part of the validation. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My application (ASP.NET Core 3.1 MVC) uses cookie authentication and has a log out button. Pretty much the standard stuff. Now when the page was open long enough, the auth cookie expires. If the user then clicks on the log out button, they get a 400 Bad Request error message. Not a pleasant view. Actually, if the user is already signed out, that operation should just no-op, not fail.
Here's the code from the AccountController class:
I've read somewhere else that the antiforgery token validation might be the problem here. Removing it was not recommended for "security reasons". But what do you suggest? How should this issue be resolved?
Beta Was this translation helpful? Give feedback.
All reactions