homebridge-lg-thinq-2 2.0.10 → 2.0.11

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Change Log
2
2
 
3
+ ## v2.0.11
4
+
5
+ ### Login
6
+
7
+ * The LG sign-in lock message is now recognized only by the prefix LG uses (`Need Sign-In Unlock`, optionally followed by colon-separated fields), instead of anywhere in any message. The fields after the prefix, which identify the account, are never shown or logged.
8
+ * The tests now use made-up account data only.
9
+
3
10
  ## v2.0.10
4
11
 
5
12
  ### Homebridge UI
package/dist/lib/Auth.js CHANGED
@@ -51,10 +51,13 @@ export const SIGN_IN_UNLOCK_MESSAGE = 'LG has locked sign-in for this account an
51
51
  + 'from a new device. Sign in to the LG ThinQ app or to your LG account on the LG website and complete '
52
52
  + 'the verification LG asks for, then try again. You can also get a refresh token with the "thinq auth" '
53
53
  + 'command, which uses the LG sign-in page.';
54
- // LG answers sign-ins to a locked account with a message like
55
- // "Need Sign-In Unlock:420:<masked email>:Y".
54
+ // LG answers a sign-in to a locked account with an error message that starts with
55
+ // "Need Sign-In Unlock", followed by colon-separated fields:
56
+ // "Need Sign-In Unlock:<code>:<masked account id>:<flag>". Only the prefix is matched,
57
+ // and the fields are never shown, because one of them identifies the account.
58
+ const SIGN_IN_UNLOCK_PATTERN = /^\s*need\s+sign[\s-]?in\s+unlock\s*(?::|$)/i;
56
59
  export function isSignInUnlockRequired(message) {
57
- return typeof message === 'string' && /sign-?in\s*unlock/i.test(message);
60
+ return typeof message === 'string' && SIGN_IN_UNLOCK_PATTERN.test(message);
58
61
  }
59
62
  function authError(context, err) {
60
63
  const message = authErrorMessage(err, 'Request failed.');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "displayName": "Homebridge LG ThinQ 2",
3
3
  "name": "homebridge-lg-thinq-2",
4
- "version": "2.0.10",
4
+ "version": "2.0.11",
5
5
  "description": "Community-maintained continuation of homebridge-lg-thinq: a Homebridge plugin for controlling/monitoring LG ThinQ devices via the LG ThinQ platform.",
6
6
  "license": "Apache-2.0",
7
7
  "type": "module",