Skip to content

Add sign in with X, as the first way in - #608

Merged
ericzakariasson merged 1 commit into
mainfrom
x-sign-in
Dec 1, 2026
Merged

ericzakariasson merged 1 commit into
mainfrom
x-sign-in

Conversation

@ericzakariasson

Copy link
Copy Markdown
Member

Summary

Adds "Sign in with X" to the main site as the first, filled button, ahead of GitHub and Google.

X is already turned on in the sign-in service both sites share, and the Grok Bot Directory already offers it. So this needs no setup: no new keys, no change to the X app, nothing to switch on.

  • The panel shows X first as the filled button, then GitHub and Google as outlined buttons. It is the same panel on the sign-in page, in the sign-in dialog and on the edit pages.
  • A pressed button says "Signing in…" and the other two are switched off. Coming back with the Back button switches them on again.
  • "Last used": the callback remembers which way a sign-in was done, and the panel marks that button from then on.
  • A line under the buttons says "Already a member? Sign in the way you did before."
  • The messages for a failed sign-in no longer name only GitHub and Google.
  • One component draws the three buttons, in place of a file for each provider.

What happens to accounts

Who signs in with X Result
A new visitor A new account, named after their X profile
Someone who used X on the Grok Bot Directory The same account
A GitHub or Google member whose X account shares an email address that matches their account here Their existing account. X is added to it.
A GitHub or Google member whose X account shares a different address, or none A new, empty account
A GitHub or Google member whose X address matches several accounts here The "couldn't tell which account is yours" message

The sign-in service joins two sign-ins into one account only when both vouch for the same email address. The X app asks X for the address, and X shares it only once the member has confirmed it there.

The fourth row is why the panel has the "Last used" mark and the line under the buttons. A member who lands in a new account sees no owner menu on their plugins and an empty profile.

I could not measure how many members the fourth row would affect, because that needs the database.

Things to know

  • Everyone was signed out by the address move, so "Last used" starts empty for all members. The line under the buttons is the only hint on a member's first sign-in back.
  • Admins added by email: that only counts for a Google or GitHub sign-in (is_admin), not for X. The README now says so. Someone added by email who uses X first is an admin once they have also signed in with Google or GitHub on the same account.
  • There is no switch for the button. If the X provider is ever turned off in the sign-in service, the button leads to that service's error page. The Grok Bot Directory's README notes this.
  • This opens no new door. X sign-in has been open on the shared sign-in service since the Grok Bot Directory turned it on. The button only makes it reachable from this site's panel.
  • Members who joined with X on the Grok Bot Directory have had no X button here until now. 219 of the 540 newest public members have an X profile photo.
  • The Grok Bot Directory changes are a comment and a README line.

Testing

  • bunx biome ci ., bun run typecheck in apps/cursor, bunx next typegen && bun run typecheck in apps/grok-bot: pass.
  • Run locally:
    • The panel on the sign-in page, in the dialog opened from a plugin's star, and on an edit page. Light and dark, desktop width and 390px.
    • Each button starts a sign-in at the sign-in service with the right provider and the right address to come back to, including the page the visitor was heading for. I stopped each one before the browser left the page.
    • "Signing in…" switches the buttons off, and a page restored by the Back button switches them on.
    • "Last used" shows on the right button for each of the three values and on none for anything else.
    • A failed sign-in sets no "Last used".
    • The cookie the callback sets, and a temporary local route confirming it arrives next to a session cookie.
  • Against the live sign-in service: starting an X sign-in redirects to X's consent page, asking for the profile and the email address.
  • Preview build: it builds, the pages are served, the panel is in the sign-in page's script, and a failed callback redirects as before.
  • Not tested: a complete X sign-in. It needs a person at X's consent screen. A preview address is most likely not on the sign-in service's list of allowed return addresses (I can't see that list), so a preview shows the panel but probably cannot complete a sign-in. The first real X sign-in on this site happens after the deploy. The steps after X's screen are the ones GitHub and Google sign-ins already use here.

The sign-in panel offered GitHub and Google. It now offers X first, as the
filled button, then GitHub and Google. X goes through the same sign-in
service as the other two, and as the Grok Bot Directory where it is
already live, so a member is the same member on both sites.

- One component draws the three buttons, in place of a file for each
  provider. A pressed button says "Signing in…" and switches the others
  off until the browser has left the page.
- The callback remembers which way a sign-in was done, and the panel
  marks that button "Last used" from then on.
- A line under the buttons tells members to sign in the way they did
  before: a different way in can be a different, empty account.
- The messages for a failed sign-in no longer name only GitHub and
  Google.
- README: a person added as an admin by email is not an admin through an
  X sign-in alone.

The panel is the same on the sign-in page, in the sign-in dialog and on
the edit pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
@ericzakariasson
ericzakariasson merged commit f1f02a5 into main Dec 1, 2026
1 check passed
@ericzakariasson
ericzakariasson deleted the x-sign-in branch December 1, 2026 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant