'Problem with [Authenticate] filter and Validator execute priority
Good Day,
I have validations with session values into a validator, if the session is expired, It has not been detected within the execution of the validator, and this validator responds with an error, a not real error.
How to change the priority of execution of [Authenticate] filter, so that the execution of this filter is before the validator.
Solution 1:[1]
Note the [Authenticate] attribute is a request filter attribute which should be applied on the service implementation whilst all the declarative validation attributes should be applied on the Request DTO.
Since you’re already using validation attributes you should use the [ValidateIsAuthenticated] type validator to validate the user is authenticated.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | mythz |
