From 25c3e9421ff8af7a0bfd5d8f46236ba88e093620 Mon Sep 17 00:00:00 2001 From: Daniel Ponte Date: Sat, 12 Nov 2022 17:42:36 -0500 Subject: [PATCH] fix now --- pkg/auth/session.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/auth/session.go b/pkg/auth/session.go index 5705826..e8988b9 100644 --- a/pkg/auth/session.go +++ b/pkg/auth/session.go @@ -103,11 +103,12 @@ const defaultExpiration = 2 * time.Hour func (a *Authenticator) NewToken(r *http.Request, user provider.ProviderUser, f *Flow) TokenID { id := TokenID(genUUID()) + now := time.Now() t := &Token{ ID: id, - Ctime: time.Now(), - Expires: time.Now().Add(defaultExpiration), + Ctime: now, + Expires: now.Add(defaultExpiration), Addr: r.RemoteAddr, user: user,