Baileys: [BUG] Pairing code login mode not working anymore

Describe the bug The auth pairing code is not working anymwore, i tried to run example.ts, the pair code shows on the console but wa doesn’t notifies about it and also, the pairing code (yes, the console shows the code!) doesn’t work on wa. 400 error on console:

{"level":10,"time":"2023-08-14T18:44:30.947Z","pid":49820,"hostname":"Desk-Ale","class":"ns","msg":"recv 63 bytes, total recv 63 bytes"}
{"level":10,"time":"2023-08-14T18:44:30.947Z","pid":49820,"hostname":"Desk-Ale","class":"ns","msg":"7679.52164-1","msg":"recv frame"}
{"level":10,"time":"2023-08-14T18:44:30.948Z","pid":49820,"hostname":"Desk-Ale","msg":"<iq from='@s.whatsapp.net' type='error' id='7679.52164-1'>\n\t\t<error code='400' text='bad-request'/>\n</iq>"}

I tried with 2 real numbers, no success! Anybody facing the same issue?

To Reproduce Steps to reproduce the behavior: Very simple: Run example.ts with --use-pairing-code and try to login

Expected behavior Receive wa notification about the code and the code work on wa

Environment (please complete the following information):

  • Is this on a server? No
  • What do your connectOptions look like? same as example.ts
  • Do you have multiple clients on the same IP? no, dev env
  • Are you using a proxy? no

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 10
  • Comments: 31 (1 by maintainers)

Commits related to this issue

Most upvoted comments

change yout makeWASocket method, example:

const sock = makeWASocket({
	browser: ['Chrome (Linux)', '', ''],
})

Chrome (Linux) - this fix it

Still not working for me, I am trying using the given Example.ts file and changing the browser to ‘Chrome (Linux)’ or ‘Chrome (MacOS)’ didn’t work for me. Every time I enter the code on my device it says incorrect code. And the logs start to give QR code for some reason after the failed attempt.

I also experienced the same thing. But when I try to enter the phone number without the plus sign it works

use whiskeysockets/baileys 6.4.1

Is it still working with ‘Chrome (Linux)’?

change yout makeWASocket method, example:

const sock = makeWASocket({
	browser: ['Chrome (Linux)', '', ''],
})

use this, it’s works for me

...
browser: Browsers.ubuntu('CHROME'),
...

because if we look at the original source, array browser[1] refers to an enum that uses uppercase letters.

Screenshot 2024-01-21 at 22 44 57 Screenshot 2024-01-21 at 22 45 33