Skip to content

chore: remove unused static/auth-client.js - #93

Open
mroderick wants to merge 1 commit into
mainfrom
chore/remove-unused-auth-client
Open

mroderick wants to merge 1 commit into
mainfrom
chore/remove-unused-auth-client

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

What

Removes static/auth-client.js and the <script type="module"> tag that loaded it from src/app/components/layout.js. 36 lines gone, no additions. Closes out the esm.sh better-auth@latest drift noted in the dependency-upgrade reviews.

Why the module is unused

  • The sign-in flow it was built for is now server-rendered: the login page renders GitHubButton (form POST to /login/github) and MagicLinkButton (form to /login/magic-link); startGitHubOAuth and sendMagicLink are plain Hono handlers.
  • No component, route, test, or e2e file references the module or its exports (handleGitHubSignIn, signIn, signUp, or the data-redirect-url attribute it reads). grep -rln authClient over src/ returns nothing outside the script itself.
  • Git history confirms the vestige: the module arrived with client-side GitHub sign-in (e84db13), had its passkey code stripped (26b1e1d), and never got re-wired after the server-side form migration.

Verification

Follow-up

None. If a browser-side auth client is needed again, it should come with a bundler (per the TODO that used to be in the file) so the browser and server versions can't drift.

Context

Supersedes the pinning approach in closed #92, which kept the unused module alive to avoid drift; removal is the better fix.

The browser Better Auth client module has no live call sites: the sign-in
flow is server-rendered (GitHubButton posts /login/github, MagicLinkButton
targets /login/magic-link), and no component, test, or e2e run references
the module or its exports. Its esm.sh @latest import was a version-drift
hazard reachable by every page load; remove it and the layout script tag.
@mroderick
mroderick marked this pull request as ready for review October 10, 2026 09:06

This branch has not been deployed

No deployments
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