mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-09-30 19:51:22 +02:00
Manage session time fields centrally
This commit is contained in:
@@ -36,8 +36,7 @@ type SessionStore struct {
|
||||
// within Cookies set on the HTTP response writer
|
||||
func (s *SessionStore) Save(rw http.ResponseWriter, req *http.Request, ss *sessions.SessionState) error {
|
||||
if ss.CreatedAt == nil || ss.CreatedAt.IsZero() {
|
||||
now := time.Now()
|
||||
ss.CreatedAt = &now
|
||||
ss.CreatedAtNow()
|
||||
}
|
||||
value, err := s.cookieForSession(ss)
|
||||
if err != nil {
|
||||
|
||||
@@ -30,8 +30,7 @@ func NewManager(store Store, cookieOpts *options.Cookie) *Manager {
|
||||
// from the persistent data store.
|
||||
func (m *Manager) Save(rw http.ResponseWriter, req *http.Request, s *sessions.SessionState) error {
|
||||
if s.CreatedAt == nil || s.CreatedAt.IsZero() {
|
||||
now := time.Now()
|
||||
s.CreatedAt = &now
|
||||
s.CreatedAtNow()
|
||||
}
|
||||
|
||||
tckt, err := decodeTicketFromRequest(req, m.Options)
|
||||
|
||||
Reference in New Issue
Block a user