GCR deployment testing in progress - css issue remaining
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
using Htmx.ApiDemo;
|
||||
using Htmx.ApiDemo.Data;
|
||||
using Immediate.Apis.Shared;
|
||||
using Immediate.Handlers.Shared;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace Htmx.ApiDemo.Templates;
|
||||
@@ -13,16 +15,13 @@ public static partial class PostLogoutHandler
|
||||
// and antiforgery token in the form is validated by the middleware.
|
||||
public class Command;
|
||||
|
||||
private static async ValueTask HandleAsync(
|
||||
private static async ValueTask<IResult> HandleAsync(
|
||||
[AsParameters] Command _,
|
||||
AuthService authService,
|
||||
IHttpContextAccessor httpContextAccessor,
|
||||
CancellationToken token)
|
||||
{
|
||||
await authService.SignOutAsync();
|
||||
|
||||
var ctx = httpContextAccessor.HttpContext
|
||||
?? throw new InvalidOperationException("HttpContext is not available.");
|
||||
ctx.Response.Redirect("/login");
|
||||
return new HtmxResult("/login");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user