Skip to content

Commit d4458a4

Browse files
authored
Merge pull request #13 from adohkan/retryflow
Further fix for #9
2 parents 25bbec3 + d043c62 commit d4458a4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

cmd/git-remote-https+iap/main.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,17 @@ func handleIAPAuthCookieFor(url string, forcebrowserflow bool) *iap.Cookie {
168168
case err != nil:
169169
log.Debug().Msgf("[handleIAPAuthCookieFor] Could not read IAP cookie for %s: %s", url, err.Error())
170170
cookie, err = iap.NewCookie(url, forcebrowserflow)
171+
if err != nil {
172+
log.Debug().Msgf("[handleIAPAuthCookieFor] Retrying with forcebrowserflow: true")
173+
cookie, err = iap.NewCookie(url, true)
174+
}
171175
case cookie.Expired():
172176
log.Debug().Msgf("[handleIAPAuthCookieFor] IAP cookie for %s has expired", url)
173177
cookie, err = iap.NewCookie(url, forcebrowserflow)
178+
if err != nil {
179+
log.Debug().Msgf("[handleIAPAuthCookieFor] Retrying with forcebrowserflow: true")
180+
cookie, err = iap.NewCookie(url, true)
181+
}
174182
case !cookie.Expired():
175183
log.Debug().Msgf("[handleIAPAuthCookieFor] IAP Cookie still valid until %s", time.Unix(cookie.Claims.ExpiresAt, 0))
176184
}

0 commit comments

Comments
 (0)