Login
You can read everything without signing in. Signing in lets you contribute: vote, create topics, propose branches, bookmark, and build your profile. The sign-in is a modal over the open page — it does not navigate you away. The Lorediv tab does not navigate to the provider. X is always offered. Google and GitHub appear when their client credentials are set. Account linking and an X handle collision use a second modal. Profile handles and the plate are in Profile. x_premium is the X verified flag, not lore rank: Rank.
| UI | When |
|---|---|
| Log in | Navbar, a guest action that needs a session, or ?openLogin=1 |
| Link accounts | Own profile, Settings |
| Handle taken | A new X login whose handle is already on Lorediv |
| Sign-in unavailable | The X collision cannot be stored. Toast only |
A sign-in attempt is limited to 5 a minute. The provider window opens as a popup. If the browser blocks it, the toast is Allow popups to sign in. The button reads Signing in... until the popup finishes or the Lorediv modal is closed. Leaving the provider page without accepting does not finish login. A session that is already signed in closes the modal.
| Provider | On a new login |
|---|---|
| X | The public X profile is the primary identity. username becomes x_handle. verified becomes x_premium. The avatar URL is stored. It is not fetched again while a public file is read. |
| A new account when that Google identity is not already linked. The handle is made unique. | |
| GitHub | A new account when that GitHub identity is not already linked. The handle is made unique. |
X cannot be disconnected. Google and GitHub show Link on Settings when that handle is empty. A provider already connected is greyed out. After a link, the Settings card stays open and the toast is Google account linked successfully. or GitHub account linked successfully. Unlink says Google account unlinked. or GitHub account unlinked. Unlinking the provider you used to sign in, when there is no X on the account, asks you to log out.
An X handle that is already taken closes login and opens the collision modal on the same page. Accept creates the account with an alias and signs that user in. Cancel strips the collision query and leaves you signed out. Google and GitHub do not use this modal.
Logout replaces the URL with /, clears the loaded profile, opens the login modal, and ends the session.
The modal footer is Terms, Privacy, Cookies, Agents, and Ads. A plain click opens that plate above the login overlay. A modifier click opens the legal page.
Code
| Piece | Path |
|---|---|
| Sign-in modal | apps/frontend/src/components/ui/LoginModal.tsx |
| Link and collision | apps/frontend/src/components/ui/AccountLinkingModal.tsx |
| Providers | apps/frontend/src/lib/auth.ts |
| Popup closer | apps/frontend/public/oauth-popup-done.html |