Skip to content

Commit

Permalink
Only read cached access token if the feature is enabled.
Browse files Browse the repository at this point in the history
Closes #264
  • Loading branch information
monde committed Jan 31, 2025
1 parent d5d59f1 commit 4e76eaa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/webssoauth/webssoauth.go
Original file line number Diff line number Diff line change
Expand Up @@ -1058,8 +1058,12 @@ func RemoveCachedAccessToken() bool {
}

// cachedAccessToken will returned the cached access token if it exists and is
// not expired.
// not expired and --cached-access-token is enabled.
func (w *WebSSOAuthentication) cachedAccessToken() (at *okta.AccessToken) {
if !w.config.CacheAccessToken() {
return
}

accessTokenPath, err := cachedAccessTokenPath()
if err != nil {
return
Expand Down

0 comments on commit 4e76eaa

Please sign in to comment.