forked from tangled.org/core
this repo has no description

appview: cache: bump session cache TTL to 7 days

Signed-off-by: oppiliappan <me@oppi.li>

oppi.li bb296e9e 1036b1ad

verified
Changed files
+3 -4
appview
cache
session
middleware
+2 -3
appview/cache/session/store.go
···
return err
}
-
// set with ttl (expires in + buffer)
-
expiry, _ := time.Parse(time.RFC3339, session.Expiry)
-
ttl := time.Until(expiry) + time.Minute
+
// set with ttl (7 days)
+
ttl := 7 * 24 * time.Hour
return s.cache.Set(ctx, key, data, ttl).Err()
}
+1 -1
appview/middleware/middleware.go
···
_, auth, err := a.GetSession(r)
if err != nil {
-
log.Printf("not logged in, redirecting")
+
log.Println("not logged in, redirecting", "err", err)
redirectFunc(w, r)
return
}