oauth: fix Token.Expired

also sent off as https://codereview.appspot.com/134830043

Change-Id: Id15fd7adb77c87a012112cbfda1d02084bd8e895
This commit is contained in:
Brad Fitzpatrick 2014-08-25 18:58:18 -07:00
parent 77a5f0f375
commit df6d04cce9
1 changed files with 4 additions and 1 deletions

View File

@ -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())