This commit is contained in:
metacryst
2025-09-30 17:44:39 -05:00
parent 7c8fd24b49
commit faf2041b7f
12 changed files with 421 additions and 270 deletions

View File

@@ -14,20 +14,14 @@ func HandleLogout(w http.ResponseWriter, r *http.Request) {
Name: "auth_token",
Value: "",
Path: "/",
Domain: "." + os.Getenv("BASE_URL"), // must match what you set when logging in
HttpOnly: true,
Domain: "." + os.Getenv("BASE_URL"), // must match what you set when logging in
Secure: true,
Expires: time.Unix(0, 0), // way in the past
MaxAge: -1, // tells browser to delete immediately
SameSite: http.SameSiteLaxMode,
}
if config.ENV == "development" {
cookie.Secure = false
cookie.Domain = ".hyperia.local"
}
http.SetCookie(w, cookie)
http.Redirect(w, r, config.BASE_URL, http.StatusSeeOther)
}