feat(security): #328 delete old sessions change password [tbs]
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 40s

This commit is contained in:
2024-12-18 21:42:05 +01:00
parent 3003e4f1bf
commit 2b46a00a49
7 changed files with 146 additions and 65 deletions

View File

@@ -8,9 +8,10 @@ import (
"time"
)
func TriggerToast(w http.ResponseWriter, r *http.Request, class string, message string) {
func TriggerToast(w http.ResponseWriter, r *http.Request, class string, message string, statusCode int) {
if isHtmx(r) {
w.Header().Set("HX-Trigger", fmt.Sprintf(`{"toast": "%v|%v"}`, class, message))
w.WriteHeader(statusCode)
} else {
log.Error("Trying to trigger toast in non-HTMX request")
}