SecurityDataFetcherExceptionResolver handles AuthenticationException
This is unlikely to happen as authentication happens prior to reaching the GraphQL APIs. However, a user may decide to implement security within GraphQL as it is possible to do through a Spring Controller.
This commit is contained in:
@@ -28,7 +28,7 @@ public class SecurityDataFetcherExceptionResolver implements DataFetcherExceptio
|
||||
@Override
|
||||
public Mono<List<GraphQLError>> resolveException(Throwable exception, DataFetchingEnvironment environment) {
|
||||
if (exception instanceof AuthenticationException) {
|
||||
// TOTO: should this be empty ?
|
||||
return unauthorized(environment);
|
||||
}
|
||||
if (exception instanceof AccessDeniedException) {
|
||||
return ReactiveSecurityContextHolder.getContext()
|
||||
|
||||
Reference in New Issue
Block a user