Skip to content

Commit

Permalink
Update Program.cs (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex committed Dec 5, 2023
1 parent 2e64333 commit a0626bf
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions 8.0/BlazorWebAssemblyStandaloneWithIdentity/Backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,17 @@
app.MapIdentityApi<AppUser>();

// provide an end point to clear the cookie for logout
app.MapPost("/Logout", async (ClaimsPrincipal user, SignInManager<AppUser> signInManager) =>
app.MapPost("/logout", async (
SignInManager<MyUser> signInManager,
[FromBody]object empty) =>
{
await signInManager.SignOutAsync();
return TypedResults.Ok();
});
if (empty is not null)
{
await signInManager.SignOutAsync();
return Results.Ok();
}
return Results.NotFound();
}).RequireAuthorization();

// activate the CORS policy
app.UseCors("wasm");
Expand Down

0 comments on commit a0626bf

Please sign in to comment.