Tesla: put proxy token into X-Authorization (#18962)
This commit is contained in:
parent
6f3321c709
commit
8e521ca653
1 changed files with 3 additions and 5 deletions
|
|
@ -66,11 +66,9 @@ func NewTeslaFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
}
|
||||
|
||||
hc := request.NewClient(log)
|
||||
baseTransport := hc.Transport
|
||||
|
||||
hc.Transport = &oauth2.Transport{
|
||||
Source: identity,
|
||||
Base: baseTransport,
|
||||
Base: hc.Transport,
|
||||
}
|
||||
|
||||
tc, err := teslaclient.NewClient(context.Background(), teslaclient.WithClient(hc))
|
||||
|
|
@ -99,9 +97,9 @@ func NewTeslaFromConfig(other map[string]interface{}) (api.Vehicle, error) {
|
|||
pc := request.NewClient(log)
|
||||
pc.Transport = &transport.Decorator{
|
||||
Decorator: transport.DecorateHeaders(map[string]string{
|
||||
"Authorization": "Bearer " + cc.ProxyToken,
|
||||
"X-Authorization": "Bearer " + cc.ProxyToken,
|
||||
}),
|
||||
Base: baseTransport,
|
||||
Base: hc.Transport,
|
||||
}
|
||||
|
||||
tcc, err := teslaclient.NewClient(context.Background(), teslaclient.WithClient(pc))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue