From df6d04cce95433f6e83cb84c4a35da6506ffffec Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 25 Aug 2014 18:58:18 -0700 Subject: [PATCH] oauth: fix Token.Expired also sent off as https://codereview.appspot.com/134830043 Change-Id: Id15fd7adb77c87a012112cbfda1d02084bd8e895 --- third_party/code.google.com/p/goauth2/oauth/oauth.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/third_party/code.google.com/p/goauth2/oauth/oauth.go b/third_party/code.google.com/p/goauth2/oauth/oauth.go index ecdbd157f..29dc8d736 100644 --- a/third_party/code.google.com/p/goauth2/oauth/oauth.go +++ b/third_party/code.google.com/p/goauth2/oauth/oauth.go @@ -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())