@eiannone/tesla-api 1.14.1 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/TeslaApi.js +8 -6
  2. package/package.json +1 -1
package/TeslaApi.js CHANGED
@@ -216,6 +216,7 @@ class TeslaApi {
216
216
  this.cb_refreshToken = callback;
217
217
  }
218
218
 
219
+ // https://tesla-api.timdorr.com/api-basics/authentication
219
220
  async refreshToken(refresh_token) {
220
221
  const payLoad = {
221
222
  grant_type: 'refresh_token',
@@ -226,12 +227,13 @@ class TeslaApi {
226
227
  try {
227
228
  let resp = await this.#oauthCall2(payLoad);
228
229
  this.refresh_token = resp.refresh_token;
229
- let oauth = await this.#oauthCall({
230
- grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
231
- client_id: '81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384',
232
- client_secret: 'c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3'
233
- }, resp.access_token);
234
- this.token = oauth.access_token;
230
+ // let oauth = await this.#oauthCall({
231
+ // grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer',
232
+ // client_id: '81527cff06843c8634fdc09e8ac0abefb46ac849f38fe1e431c2ef2106796384',
233
+ // client_secret: 'c7257eb71a564034f9419ee651c7d0e5f7aa6bfbd18bafb5c5c033b093bb2fa3'
234
+ // }, resp.access_token);
235
+ // this.token = oauth.access_token;
236
+ this.token = resp.access_token;
235
237
  if (typeof this.cb_refreshToken == 'function') {
236
238
  this.cb_refreshToken(this.token, this.refresh_token);
237
239
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eiannone/tesla-api",
3
- "version": "1.14.1",
3
+ "version": "1.15.0",
4
4
  "description": "Nodejs Tesla API",
5
5
  "type": "module",
6
6
  "main": "index.js",