Skip to content

Commit 93f753a

Browse files
myieyeclaude
andcommitted
fix(auth): convert /api/auth/logout to POST
The endpoint was a MapGet, which made it CSRF-able: an <img> tag on any page open in the same browser could fire it and silently sign the user out of FwLite Web. Switch to POST and drop the server-side redirect (no callers were relying on either — the viewer logs out via the [JSInvokable] Blazor interop method, not HTTP). Refs #2306 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 25833ad commit 93f753a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

backend/FwLite/FwLiteWeb/Routes/AuthRoutes.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ public static IEndpointConventionBuilder MapAuthRoutes(this WebApplication app)
4242
{
4343
return new { name = await authService.GetLoggedInName(options.Value.GetServerByAuthority(authority)) };
4444
});
45-
group.MapGet("/logout/{authority}",
45+
group.MapPost("/logout/{authority}",
4646
async (AuthService authService, string authority, IOptions<AuthConfig> options) =>
4747
{
4848
await authService.Logout(options.Value.GetServerByAuthority(authority));
49-
return Results.Redirect("/");
49+
return Results.Ok();
5050
});
5151
return group;
5252
}

0 commit comments

Comments
 (0)