poe icon indicating copy to clipboard operation
poe copied to clipboard

sendVerificationCodeMutation not working

Open marcioscf opened this issue 2 years ago • 3 comments

Okay, so I have tested manually if the https://github.com/cemalgnlts/Mailjs would work as a new service for email. Doing the steps by hand, works just fine, and I even initialized the changes on the project at the mail file. The problem is: The mutation to try and send the verification code is not working and i coulddnt get it to work at all. If anyone can help me get it to work, I can manage to update the mail config to the auto email login and renew function

marcioscf avatar Jul 13 '23 03:07 marcioscf

Hi, I'm not quite understand by "the mutation to try and send the verification code". Do you mean that when we choose the auto login and fill the email, it didn't send the email? Also, can you provide the changes on mail file to me? Thank you

muharamdani avatar Jul 13 '23 03:07 muharamdani

Whenever i try to send the verification code via the mutation, it gives a 401 bad request error. I can't get it to work no mather what I try and it did not send the email. And sure! Here is the code for mail file:

`import Mailjs from "@cemalgnlts/mailjs";

const createNewEmail = async () => { const mailjs = new Mailjs(); const email = await mailjs.createOneAccount();

return { email: (email.data as any).username, password: (email.data as any).password, }; };

const getEmailList = async (logged) => { return await logged.getMessages(); };

const getLatestEmail = async (logged) => { let emailList = await getEmailList(logged); let emailListLength = 0; while (emailListLength === 0) { await new Promise((r) => setTimeout(r, 1500)); emailList = await getEmailList(logged); emailListLength = emailList.data.length; } return emailList.data[0]; }; const getEmailContent = async (logged, id) => { const content = await logged.getMessage(id); const resp = /\b(?<!#)\d{6}\b/g.exec(content.data.html)?.[0]; return resp }; const getPoeOTPCode = async (email, pw) => { const mailjs = new Mailjs(); await mailjs.login(email, pw);

const emailData = await getLatestEmail(mailjs); return await getEmailContent(mailjs, emailData.id); }; export { createNewEmail, getEmailList, getLatestEmail, getEmailContent, getPoeOTPCode, }; `

marcioscf avatar Jul 13 '23 23:07 marcioscf

I think it caused by missing recaptchaToken on send verification code mutation, especially from queryName "MainSignupLoginSection_sendVerificationCodeMutation_Mutation", since the code didn't send the token, it will cause 401 bad request.

Actually, the recaptchaToken can be get from https://www.recaptcha.net/recaptcha/enterprise/reload, but it takes k query params and some request payload which I don't have any idea where the payload come from.

muharamdani avatar Jul 16 '23 10:07 muharamdani