We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2e64333 commit a0626bfCopy full SHA for a0626bf
8.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs
@@ -42,11 +42,17 @@
42
app.MapIdentityApi<AppUser>();
43
44
// provide an end point to clear the cookie for logout
45
-app.MapPost("/Logout", async (ClaimsPrincipal user, SignInManager<AppUser> signInManager) =>
+app.MapPost("/logout", async (
46
+ SignInManager<MyUser> signInManager,
47
+ [FromBody]object empty) =>
48
{
- await signInManager.SignOutAsync();
- return TypedResults.Ok();
49
-});
+ if (empty is not null)
50
+ {
51
+ await signInManager.SignOutAsync();
52
+ return Results.Ok();
53
+ }
54
+ return Results.NotFound();
55
+}).RequireAuthorization();
56
57
// activate the CORS policy
58
app.UseCors("wasm");
0 commit comments