session validation/invalidation

This commit is contained in:
ari melody 2025-04-29 16:31:39 +01:00
parent 1c0e541c89
commit 562ed2e015
Signed by: ari
GPG key ID: 60B5F0386E3DDB7E
4 changed files with 19 additions and 6 deletions

View file

@ -483,7 +483,7 @@ func staticHandler() http.Handler {
func enforceSession(app *model.AppState, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
session, err := controller.GetSessionFromRequest(app.DB, r)
session, err := controller.GetSessionFromRequest(app, r)
if err != nil {
fmt.Fprintf(os.Stderr, "WARN: Failed to retrieve session: %v\n", err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)