Skip to content

Commit 7613600

Browse files
authored
Merge pull request #14 from henricook/extra-log
Add a log entry if JWT parsing fails
2 parents d4458a4 + b3843ba commit 7613600

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/iap/cookie.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,9 @@ func parseJWToken(rawToken string) (jwt.Token, jwt.StandardClaims, error) {
162162
var claims jwt.StandardClaims
163163

164164
token, _, err := p.ParseUnverified(rawToken, &claims)
165+
if err != nil {
166+
log.Debug().Msgf("Token parse failed. It might not have refreshed properly. Is your account locked or invalid? If not: Try clearing ~/.git-credentials and ~/.config/gcp-iap/*.cookie")
167+
}
165168
return *token, claims, err
166169
}
167170

0 commit comments

Comments
 (0)