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

View File

@@ -122,7 +122,7 @@ export class WAConnection extends EventEmitter {
macKey: Buffer.isBuffer(authInfo.macKey) ? authInfo.macKey : Buffer.from(authInfo.macKey, 'base64'),
}
} 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 = {
clientID: authInfo.WABrowserId.replace(/\"/g, ''),
serverToken: authInfo.WAToken2.replace(/\"/g, ''),