Skip to content

Commit

Permalink
GrpcSecurityInterceptor should run cmd on correct context
Browse files Browse the repository at this point in the history
  • Loading branch information
michalvavrik committed Jul 4, 2023
1 parent 60da8ba commit 9d3c758
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,14 @@ public <ReqT, RespT> ServerCall.Listener<ReqT> interceptCall(ServerCall<ReqT, Re
try {
AuthenticationRequest authenticationRequest = securityMechanism.createAuthenticationRequest(metadata);
Context context = Vertx.currentContext();
boolean onEventLoopThread = Context.isOnEventLoopThread();

if (authenticationRequest != null) {
Uni<SecurityIdentity> auth = identityProviderManager
.authenticate(authenticationRequest)
.emitOn(new Executor() {
@Override
public void execute(Runnable command) {
if (onEventLoopThread) {
if (Context.isOnEventLoopThread()) {
context.runOnContext(new Handler<>() {
@Override
public void handle(Void event) {
Expand Down

0 comments on commit 9d3c758

Please sign in to comment.