Skip to content

Allow for more URL changes during login#657

Merged
redshiftzero merged 1 commit into
mainfrom
x-login-woes
Jun 6, 2026
Merged

Allow for more URL changes during login#657
redshiftzero merged 1 commit into
mainfrom
x-login-woes

Conversation

@micahflee
Copy link
Copy Markdown
Member

I got a report from a Cyd user that 1) they were trying to login to their X account and it wasn't detecting it and 2) the UI for archive-only mode was confusing.

This PR addresses the first one. I'm not reproducing the issue, but I think this fixes it anyway, based on the error report they submitted. The login function includes:

  // Load the login page and wait for it to redirect to home
  await vm.loadURLWithRateLimit("https://x.com/login", [
    "https://x.com/home",
    "https://x.com/i/flow/login",
  ]);

It loads https://x.com/login, and the other two URLs (https://x.com/home and https://x.com/i/flow/login) are expected to load. Once it finally makes it to https://x.com/home, it concludes that the login was successful.

Based on the error report, it actually tried loading https://x.com/i/jf/onboarding/web?mode=login, which triggered an error. It seems that X changed their login flow, at least for this user. So to keep things simpler and more robust, I've changed it so that any URL that starts with https://x.com/i/ is an expected URL and won't throw an error. This should allow URLs like https://x.com/i/jf/onboarding/web?mode=login through, and allow for completing the login.

This is from the error report that they submitted:

{
  "logs": [
    {
      "timestamp": "2026-06-04T21:08:34.551Z",
      "func": "run",
      "message": "running state: Login"
    },
    {
      "timestamp": "2026-06-04T21:08:34.551Z",
      "func": "login",
      "message": "logging in"
    },
    {
      "timestamp": "2026-06-04T21:08:34.551Z",
      "func": "loadURLWithRateLimit",
      "message": [
        "https://x.com/login",
        [
          "https://x.com/home",
          "https://x.com/i/flow/login"
        ],
        false
      ]
    },
    {
      "timestamp": "2026-06-04T21:08:34.552Z",
      "func": "waitForLoadingToFinish",
      "message": "waiting for loading to finish"
    },
    {
      "timestamp": "2026-06-04T21:08:34.605Z",
      "func": "domReadyHandler",
      "message": "dom-ready"
    },
    {
      "timestamp": "2026-06-04T21:08:34.753Z",
      "func": "waitForLoadingToFinish",
      "message": "loading finished"
    },
    {
      "timestamp": "2026-06-04T21:08:34.753Z",
      "func": "loadURL",
      "message": "try #0, https://x.com/login"
    },
    {
      "timestamp": "2026-06-04T21:08:35.959Z",
      "func": "loadURL",
      "message": "URL loaded successfully"
    },
    {
      "timestamp": "2026-06-04T21:08:35.959Z",
      "func": "waitForLoadingToFinish",
      "message": "waiting for loading to finish"
    },
    {
      "timestamp": "2026-06-04T21:08:36.160Z",
      "func": "waitForLoadingToFinish",
      "message": "loading finished"
    },
    {
      "timestamp": "2026-06-04T21:08:36.160Z",
      "func": "loadURLWithRateLimit",
      "message": "URL loaded successfully"
    },
    {
      "timestamp": "2026-06-04T21:08:36.160Z",
      "func": "loadURLWithRateLimit",
      "message": "checking if URL changed"
    },
    {
      "timestamp": "2026-06-04T21:08:36.161Z",
      "func": "loadURLWithRateLimit",
      "message": "UNEXPECTED, URL change to https://x.com/i/jf/onboarding/web?mode=login"
    }
  ],
  "currentURL": "https://x.com/i/jf/onboarding/web?mode=login"
}

@micahflee
Copy link
Copy Markdown
Member Author

Scratch that -- I just reproduced it, and this seems to fix it for me.

Copy link
Copy Markdown
Contributor

@redshiftzero redshiftzero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't repro the original issue, but this makes sense and login still works

@redshiftzero redshiftzero merged commit 0aa282d into main Jun 6, 2026
1 check passed
@redshiftzero redshiftzero deleted the x-login-woes branch June 6, 2026 22:58
@redshiftzero
Copy link
Copy Markdown
Contributor

Actually I take that back, I was able to reproduce this bug while testing #658, I cherry-picked this commit into that branch and confirmed it resolves :)

@redshiftzero redshiftzero mentioned this pull request Jun 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants