pedroslopez / whatsapp-web.js

A WhatsApp client library for NodeJS that connects through the WhatsApp Web browser app
https://wwebjs.dev
Apache License 2.0
15.21k stars 3.63k forks source link

session is undefined #2030

Closed oendnsk675 closed 8 months ago

oendnsk675 commented 1 year ago

Is there an existing issue for this?

Describe the bug

i want to se session from authenticated listener, but in callback i'm getting undefined response, below my code: client.on('authenticated', (session) => { socket.emit('status', 'authenticated'); console.log(session); // his show undefined😢 });

Expected behavior

filed session

Steps to Reproduce the Bug or Issue

undefined response

Relevant Code

client.on('authenticated', (session) => { socket.emit('status', 'authenticated'); console.log(session); // his show undefined😢 });

Browser Type

Chromium

WhatsApp Account Type

Standard

Does your WhatsApp account have multidevice enabled?

Yes, I am using Multi Device

Environment

Windows 10

Additional context

No response

joulgs commented 1 year ago

hey, did you solve it?

neckell commented 1 year ago

same problem here

frnndwrms commented 1 year ago

Same problem here. I get the session through store.

El dom, 18 de jun. de 2023 4:55 a. m., Nicolas Eckell < @.***> escribió:

same problem here

— Reply to this email directly, view it on GitHub https://github.com/pedroslopez/whatsapp-web.js/issues/2030#issuecomment-1596016171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOQBBZK67CSGEJ2HEATR7MDXL2X5JANCNFSM6AAAAAAVH4E6RE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

getsettalk commented 11 months ago

still same problem in version :1.22.1

alechkos commented 8 months ago

A session object within an authenticated event have been working with LegacySessionAuth strategy, as soon as WhatsApp moved to multidevice-enabled accounts this strategy is not working anymore. Use LocalAuth strategy instead.