Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Oct 14, 2022
1 parent 48ab259 commit 36438a4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vehicle/mercedes/tokensource.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func (ts *ReuseTokenSource) Token() (*oauth2.Token, error) {

valid := err == nil && token.Valid()
if valid && ts.store != nil {
ts.store.Save(token)
err = ts.store.Save(token)
}

// update status
Expand All @@ -46,13 +46,13 @@ func (ts *ReuseTokenSource) Token() (*oauth2.Token, error) {
return token, err
}

func (ts *ReuseTokenSource) Update(t *oauth2.Token) {
func (ts *ReuseTokenSource) Update(token *oauth2.Token) {
if ts.store != nil {
ts.store.Save(t)
_ = ts.store.Save(token)
}

ts.mu.Lock()
ts.ts = ts.oc.TokenSource(context.Background(), t)
ts.ts = ts.oc.TokenSource(context.Background(), token)
ts.mu.Unlock()

// update status
Expand Down

0 comments on commit 36438a4

Please sign in to comment.