This commit is contained in:
Daniel Ponte 2022-11-12 17:42:36 -05:00
parent 1aa1296732
commit 25c3e9421f

View file

@ -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,