Skip to content

Commit 52572c9

Browse files
committed
SecurityDataFetcherExceptionResolver.setAuthenticationTrustResolver
1 parent 4aed514 commit 52572c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

samples/webflux-security/src/main/java/io/spring/sample/graphql/SecurityDataFetcherExceptionResolver.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import graphql.GraphQLError;
77
import graphql.GraphqlErrorBuilder;
88
import graphql.schema.DataFetchingEnvironment;
9+
import org.springframework.util.Assert;
910
import reactor.core.publisher.Mono;
1011

1112
import org.springframework.graphql.execution.DataFetcherExceptionResolver;
@@ -40,6 +41,11 @@ public Mono<List<GraphQLError>> resolveException(Throwable exception, DataFetchi
4041
return Mono.empty();
4142
}
4243

44+
public void setAuthenticationTrustResolver(AuthenticationTrustResolver authenticationTrustResolver) {
45+
Assert.notNull(authenticationTrustResolver, "authenticationTrustResolver cannot be null");
46+
this.authenticationTrustResolver = authenticationTrustResolver;
47+
}
48+
4349
private Mono<List<GraphQLError>> unauthorized(DataFetchingEnvironment environment) {
4450
return Mono.fromCallable(() -> Arrays.asList(
4551
GraphqlErrorBuilder.newError(environment)

0 commit comments

Comments
 (0)