homebridge-melcloud-control 4.0.0-beta.271 → 4.0.0-beta.272

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "MELCloud Control",
3
3
  "name": "homebridge-melcloud-control",
4
- "version": "4.0.0-beta.271",
4
+ "version": "4.0.0-beta.272",
5
5
  "description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
6
6
  "license": "MIT",
7
7
  "author": "grzegorz914",
@@ -32,11 +32,7 @@ class MelCloudHomeToken {
32
32
  async getLoginPage(authUrl) {
33
33
  console.log('Getting login page...');
34
34
  const res = await this.client.get(authUrl, { maxRedirects: 10 });
35
- const $ = cheerio.load(res.data);
36
- const csrf = $('input[name="_csrf"]').attr('value');
37
- if (!csrf) throw new Error('Could not extract CSRF token from login page');
38
- console.log('CSRF token found:', csrf);
39
- return { csrf, url: res.request.res.responseUrl };
35
+ return { url: res.request.res.responseUrl };
40
36
  }
41
37
 
42
38
  async getUrl() {
@@ -56,7 +52,7 @@ class MelCloudHomeToken {
56
52
 
57
53
  const loginPage = await this.getLoginPage(authUrl.toString());
58
54
 
59
- return loginPage;
55
+ return loginPage.url;
60
56
  } catch (error) {
61
57
  console.error('Failed to obtain OAuth tokens:', error);
62
58
  throw error;