browser authInfo load fix

This commit is contained in:
Adhiraj
2020-08-27 22:01:38 +05:30
parent 2ce9a1c28d
commit 299ebf5179
3 changed files with 4 additions and 3 deletions

3
.gitignore vendored
View File

@@ -10,4 +10,5 @@ browser-messages.json
decoded-ws.json decoded-ws.json
auth_info2.json auth_info2.json
lib lib
doc docs
browser-token.json

View File

@@ -122,7 +122,7 @@ export class WAConnection extends EventEmitter {
macKey: Buffer.isBuffer(authInfo.macKey) ? authInfo.macKey : Buffer.from(authInfo.macKey, 'base64'), macKey: Buffer.isBuffer(authInfo.macKey) ? authInfo.macKey : Buffer.from(authInfo.macKey, 'base64'),
} }
} else { } else {
const secretBundle: {encKey: string, macKey: string} = typeof authInfo === 'string' ? JSON.parse (authInfo): authInfo const secretBundle: {encKey: string, macKey: string} = typeof authInfo.WASecretBundle === 'string' ? JSON.parse (authInfo.WASecretBundle): authInfo.WASecretBundle
this.authInfo = { this.authInfo = {
clientID: authInfo.WABrowserId.replace(/\"/g, ''), clientID: authInfo.WABrowserId.replace(/\"/g, ''),
serverToken: authInfo.WAToken2.replace(/\"/g, ''), serverToken: authInfo.WAToken2.replace(/\"/g, ''),

View File

@@ -1,5 +1,5 @@
{ {
"inputFiles": ["./src"], "inputFiles": ["./src/Binary", "./src/WAConnection", "./WAMessage"],
"mode": "modules", "mode": "modules",
"out": "docs" "out": "docs"
} }