Skip to content

Commit

Permalink
Add login endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalSenn committed Jun 24, 2024
1 parent 0ea5450 commit ed6c601
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions src/Server/src/AspNet/Security/EnsureAuthenticatedMiddleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit ed6c601

Please sign in to comment.