feat: page reload on auth event

This commit is contained in:
efim
2023-10-06 12:25:37 +00:00
parent bb418101dd
commit 2676b87d5b
3 changed files with 66 additions and 26 deletions

View File

@@ -119,6 +119,7 @@ func getLogoutRoute(app *pocketbase.PocketBase) func(*core.ServeEvent) error {
Path: "/",
MaxAge: -1,
})
c.Response().Header().Add("HX-Trigger", "auth-change-event")
return c.JSON(http.StatusOK, map[string]string{"message": "session cookie removed"})
})
return nil