Skip to content

Commit ed6c601

Browse files
committed
Add login endpoint
1 parent 0ea5450 commit ed6c601

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/Server/src/AspNet/Security/EnsureAuthenticatedMiddleware.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,17 @@ public EnsureAuthenticatedMiddleware(
2222

2323
public async Task InvokeAsync(HttpContext context)
2424
{
25-
if (context.Request.Path.StartsWithSegments("/_health") ||
26-
context.Request.Path.StartsWithSegments("/fonts") ||
27-
context.Request.Path.StartsWithSegments("/api/session") ||
28-
_env.IsDevelopment())
29-
{
30-
await _next(context);
31-
32-
return;
33-
}
34-
3525
if (context.Request.Path.StartsWithSegments("/api/session/auth"))
3626
{
3727
await context.ChallengeAsync();
3828
}
29+
else if (context.Request.Path.StartsWithSegments("/_health") ||
30+
context.Request.Path.StartsWithSegments("/fonts") ||
31+
context.Request.Path.StartsWithSegments("/api/session") ||
32+
_env.IsDevelopment())
33+
{
34+
await _next(context);
35+
}
3936
else if (
4037
context.Request.Path.StartsWithSegments("/api")
4138
|| context.Request.Path.StartsWithSegments("/graphql")

0 commit comments

Comments
 (0)