Skip to content

Commit

Permalink
PSA: delete token from settings db if invalid (#16183)
Browse files Browse the repository at this point in the history
  • Loading branch information
hurzhurz authored Sep 17, 2024
1 parent 0157ea6 commit 6be3ed0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vehicle/psa/identity.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ func (v *Identity) RefreshToken(token *oauth2.Token) (*oauth2.Token, error) {

tok, err := v.oc.TokenSource(ctx, token).Token()
if err != nil {
if strings.Contains(err.Error(), "invalid_grant") {
settings.Delete(v.subject)
}
return nil, err
}

Expand Down

0 comments on commit 6be3ed0

Please sign in to comment.