mirror of https://github.com/perkeep/perkeep.git
oauth: fix Token.Expired
also sent off as https://codereview.appspot.com/134830043 Change-Id: Id15fd7adb77c87a012112cbfda1d02084bd8e895
This commit is contained in:
parent
77a5f0f375
commit
df6d04cce9
|
@ -167,7 +167,10 @@ type Token struct {
|
|||
|
||||
// Expired reports whether the token has expired or is invalid.
|
||||
func (t *Token) Expired() bool {
|
||||
if t.Expiry.IsZero() || t.AccessToken == "" {
|
||||
if t.AccessToken == "" {
|
||||
return true
|
||||
}
|
||||
if t.Expiry.IsZero() {
|
||||
return false
|
||||
}
|
||||
return t.Expiry.Before(time.Now())
|
||||
|
|
Loading…
Reference in New Issue