VW: fix token refresh (#25693)

This commit is contained in:
Oliver Rahner 2025-11-30 22:16:15 +01:00 • committed by GitHub
parent d4999cd28c
commit 9fef8d45e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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
}