VW: fix token refresh (#25693)
This commit is contained in:
parent
d4999cd28c
commit
9fef8d45e3
1 changed files with 3 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import (
|
|||
"net/http"
|
||||
"net/url"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/evcc-io/evcc/util/oauth"
|
||||
|
|
@ -77,6 +78,8 @@ func (v *Service) Refresh(token *Token) (*Token, error) {
|
|||
err = v.DoJSON(req, &res)
|
||||
}
|
||||
|
||||
res.Expiry = time.Now().Add(time.Duration(res.ExpiresIn) * time.Second)
|
||||
|
||||
t := Token(res)
|
||||
return &t, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue