diff --git a/src/Server/src/AspNet/Security/EnsureAuthenticatedMiddleware.cs b/src/Server/src/AspNet/Security/EnsureAuthenticatedMiddleware.cs index 7e6ece5..c0c16a3 100644 --- a/src/Server/src/AspNet/Security/EnsureAuthenticatedMiddleware.cs +++ b/src/Server/src/AspNet/Security/EnsureAuthenticatedMiddleware.cs @@ -22,20 +22,17 @@ public EnsureAuthenticatedMiddleware( public async Task InvokeAsync(HttpContext context) { - if (context.Request.Path.StartsWithSegments("/_health") || - context.Request.Path.StartsWithSegments("/fonts") || - context.Request.Path.StartsWithSegments("/api/session") || - _env.IsDevelopment()) - { - await _next(context); - - return; - } - if (context.Request.Path.StartsWithSegments("/api/session/auth")) { await context.ChallengeAsync(); } + else if (context.Request.Path.StartsWithSegments("/_health") || + context.Request.Path.StartsWithSegments("/fonts") || + context.Request.Path.StartsWithSegments("/api/session") || + _env.IsDevelopment()) + { + await _next(context); + } else if ( context.Request.Path.StartsWithSegments("/api") || context.Request.Path.StartsWithSegments("/graphql")