agentic icon indicating copy to clipboard operation
agentic copied to clipboard

Session token undefined - unable to get auth credentials

Open tedjames opened this issue 2 years ago • 0 comments

For some reason, I am seeing that the session token is undefined when I log it:

sessionToken: undefined

Here's a function I'm using to log the auth object:

export async function logAuth() {
  const openAIAuth = await getOpenAIAuth({
    email: process.env.OPENAI_EMAIL,
    password: process.env.OPENAI_PASSWORD,
  });
  console.log('AUTH CREDENTIALS: ', { openAIAuth });
}

I get the clearanceToken, userAgent and cookies object just fine.

One thing to note... I am having to refresh the browser several times to access the actual log-in page. After it comes up, puppeteer immediately closes the browser and logs the auth object with an undefined sessionToken. I tested the clearanceToken last night when it was happening and oddly enough that still worked fine.

Any ideas on what I might be doing wrong here? I don't think that puppeteer is even getting to the login page that has the email input field. It just shows the two login/register buttons and then immediately closes the browser. This would explain why I'm getting the cloudflare token and not the session token - but it doesn't explain what's causing it.

Any suggestions?

tedjames avatar Dec 13 '22 16:12 tedjames