Open cnshenj opened 2 years ago
@cnshenj Looks like the tesla api timeouts on purpose due to got's default user-agent. Probably related to following
Avoid setting a User-Agent header that looks like a browser (such as Chrome or Safari). The SSO service has protections in place that will require executing JavaScript if a browser-like user agent is detected.
from https://tesla-api.timdorr.com/api-basics/authentication#step-1-obtain-the-login-page
For example this works for me
const response = await got.get("https://auth.tesla.com/oauth2/v3/authorize", {
headers: {
'user-agent': 'no urls'
}
});
Describe the bug
Actual behavior
got
hangs when calling Tesla auth API: GET https://auth.tesla.com/oauth2/v3/authorizenode-fetch
properly returns data (Bad Request
when no query parameters are provided):...
Expected behavior
...
Code to reproduce
Checklist