AUTH-3375 exchangeOrgToken deleted cookie fix

This commit is contained in:
Akemi Davisson 2021-02-09 11:49:16 -06:00
parent d8bee0b4d9
commit 67680f5536
1 changed files with 3 additions and 1 deletions

View File

@ -301,7 +301,9 @@ func exchangeOrgToken(appURL *url.URL, orgToken string) (string, error) {
resp.Body.Close()
var appToken string
for _, c := range resp.Cookies() {
if c.Name == tokenHeader {
//if Org token revoked on exchange, getTokensFromEdge instead
validAppToken := c.Name == tokenHeader && time.Now().Before(c.Expires)
if validAppToken {
appToken = c.Value
break
}