Skip to content

Commit

Permalink
Add Jwt option for gql query
Browse files Browse the repository at this point in the history
  • Loading branch information
sky1045 committed Dec 6, 2023
1 parent b64f9b3 commit a9887a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions NineChronicles.Headless/GraphTypes/StandaloneQuery.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class StandaloneQuery : ObjectGraphType
public StandaloneQuery(StandaloneContext standaloneContext, IConfiguration configuration, ActionEvaluationPublisher publisher, StateMemoryCache stateMemoryCache)
{
bool useSecretToken = configuration[GraphQLService.SecretTokenKey] is { };
if (Convert.ToBoolean(configuration.GetSection("Jwt")["EnableJwtAuthentication"]))
{
this.AuthorizeWith(GraphQLService.JwtPolicyKey);
}

Field<NonNullGraphType<StateQuery>>(name: "stateQuery", arguments: new QueryArguments(
new QueryArgument<ByteStringType>
Expand Down

0 comments on commit a9887a7

Please sign in to comment.