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

This commit is contained in:
2024-12-17 22:21:46 +01:00
parent 957341eda5
commit b3308d6a90
13 changed files with 288 additions and 120 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")
}