Skip to content

Commit

Permalink
undo changes, wait on all delegates (#2524)
Browse files Browse the repository at this point in the history
  • Loading branch information
westin-m authored Oct 17, 2023
1 parent ceff540 commit 987aeb1
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ internal static void WebAppCallsWebApiImplementation(
};

// Handling the token validated to get the client_info for cases where tenantId is not present (example: B2C)
options.Events.OnTokenValidated += async context =>
var onTokenValidatedHandler = options.Events.OnTokenValidated;
options.Events.OnTokenValidated = async context =>
{
string? clientInfo = context!.ProtocolMessage?.GetParameter(ClaimConstants.ClientInfo);

Expand All @@ -179,7 +180,7 @@ internal static void WebAppCallsWebApiImplementation(
context!.Principal!.Identities.FirstOrDefault()?.AddClaim(new Claim(ClaimConstants.UniqueObjectIdentifier, clientInfoFromServer.UniqueObjectIdentifier));
}
}
await Task.CompletedTask;
await onTokenValidatedHandler(context).ConfigureAwait(false);
};

// Handling the sign-out: removing the account from MSAL.NET cache
Expand Down

0 comments on commit 987aeb1

Please sign in to comment.