Skip to content

Commit

Permalink
Prevent access token writen to config file if stored in keyring (auth…
Browse files Browse the repository at this point in the history
…0#919)

Fixing error check

Co-authored-by: Will Vedder <will.vedder@okta.com>
  • Loading branch information
willvedd and willvedd authored Nov 22, 2023
1 parent de12895 commit ea60669
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/config/tenant.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (t *Tenant) RegenerateAccessToken(ctx context.Context) error {
t.ExpiresAt = time.Now().Add(time.Duration(tokenResponse.ExpiresIn) * time.Second)
}

if err := keyring.StoreAccessToken(t.Domain, t.AccessToken); err != nil {
if err := keyring.StoreAccessToken(t.Domain, t.AccessToken); err == nil {
t.AccessToken = ""
}

Expand Down

0 comments on commit ea60669

Please sign in to comment.