fix now
This commit is contained in:
parent
1aa1296732
commit
25c3e9421f
1 changed files with 3 additions and 2 deletions
|
@ -103,11 +103,12 @@ const defaultExpiration = 2 * time.Hour
|
||||||
|
|
||||||
func (a *Authenticator) NewToken(r *http.Request, user provider.ProviderUser, f *Flow) TokenID {
|
func (a *Authenticator) NewToken(r *http.Request, user provider.ProviderUser, f *Flow) TokenID {
|
||||||
id := TokenID(genUUID())
|
id := TokenID(genUUID())
|
||||||
|
now := time.Now()
|
||||||
|
|
||||||
t := &Token{
|
t := &Token{
|
||||||
ID: id,
|
ID: id,
|
||||||
Ctime: time.Now(),
|
Ctime: now,
|
||||||
Expires: time.Now().Add(defaultExpiration),
|
Expires: now.Add(defaultExpiration),
|
||||||
Addr: r.RemoteAddr,
|
Addr: r.RemoteAddr,
|
||||||
|
|
||||||
user: user,
|
user: user,
|
||||||
|
|
Loading…
Reference in a new issue