Open YosefAdPro opened 5 months ago
Next release of @wppconnect-server
ref: https://github.com/wppconnect-team/wppconnect/issues/1921#issuecomment-1986845431
is this as simple as adding this in createSessionUtil()?
phoneNumber: client.config?.phoneNumber,
I've tried it locally but it doesn't return the link code for some reason :(
Also, a new route similar to POST /qrcode-session which gets you the link code would be nice.
is this as simple as adding this in createSessionUtil()?
phoneNumber: client.config?.phoneNumber,
I've tried it locally but it doesn't return the link code for some reason :(
Also, a new route similar to POST /qrcode-session which gets you the link code would be nice.
So that's one way. At the moment we have not yet implemented it in a standard way on the server, it will soon be implemented in the next release.
const wppClient = await create(
Object.assign(
{},
{ tokenStore: myTokenStore },
req.serverOptions.createOptions,
{
session: session,
phoneNumber: '5521999999999',
deviceName:
client.config?.deviceName || req.serverOptions.deviceName,
poweredBy:
client.config?.poweredBy ||
req.serverOptions.poweredBy ||
'WPPConnect-Server',
[...code....]
With the newest release, I tried the above but still it doesn't output the code in the terminal.
After some debugging I found that it gets stuck in evaluateAndReturn:
protected async loginByCode(phone: string) {
const code = await evaluateAndReturn(
this.page,
async ({ phone }) => {
return JSON.parse(
JSON.stringify(await WPP.conn.genLinkDeviceCodeForPhoneNumber(phone))
);
},
{ phone }
);
For some reason, when the wppconnect is ran through wppconnect-server, WPP.conn.genLinkDeviceCodeForPhoneNumber does not return at all. It's weird because wppconnect by itself does return the code, so this may be a configuration issue on wppconnect-server.
Hi, is this feature still gonna get added?
With the newest release, I tried the above but still it doesn't output the code in the terminal.
After some debugging I found that it gets stuck in evaluateAndReturn:
protected async loginByCode(phone: string) { const code = await evaluateAndReturn( this.page, async ({ phone }) => { return JSON.parse( JSON.stringify(await WPP.conn.genLinkDeviceCodeForPhoneNumber(phone)) ); }, { phone } );
For some reason, when the wppconnect is ran through wppconnect-server, WPP.conn.genLinkDeviceCodeForPhoneNumber does not return at all. It's weird because wppconnect by itself does return the code, so this may be a configuration issue on wppconnect-server.
did you manage to find a solution to the problem?
This is the only way getting the code works
const wppClient = await create({
session: session,
phoneNumber: '55555555555',
catchLinkCode: (code: string) => {
console.log(code);
},
autoClose: 1000000,
});
if you delete this
deviceName:
client.config?.deviceName || req.serverOptions.deviceName,
poweredBy:
client.config?.poweredBy ||
req.serverOptions.poweredBy ||
'WPPConnect-Server',
then everything works
https://github.com/wppconnect-team/wppconnect/issues/2031