forked from tangled.org/core
Monorepo for Tangled

appview: cache: bump session cache TTL to 7 days

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

authored by oppi.li and committed by Tangled 038a852f 1036b1ad

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