Skip to content

refactor(auth): use useMutation for social sign-in in LoginButton#1340

Merged
fhennig merged 1 commit into
mainfrom
fix/use-mutation-login-button
Jul 15, 2026
Merged

refactor(auth): use useMutation for social sign-in in LoginButton#1340
fhennig merged 1 commit into
mainfrom
fix/use-mutation-login-button

Conversation

@fhennig

@fhennig fhennig commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Wraps authClient.signIn.social() in a useMutation hook, replacing the raw .catch() pattern
  • Moves error handling to the onError callback, consistent with how other async operations are handled in the codebase
  • Wraps the component with withQueryProvider so it has access to the query client

Closes #1209

🤖 Generated with Claude Code

Replaces raw .catch() chaining with useMutation to align with the
codebase's established pattern for async operations and error handling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
dashboards Ready Ready Preview, Comment Jul 14, 2026 11:13am

Request Review

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors the LoginButton React component in the website/ frontend to align social sign-in with the existing React Query async pattern (via useMutation) and to ensure the component has access to a QueryClient when rendered standalone from Astro.

Changes:

  • Wraps authClient.signIn.social() in a useMutation hook and moves error handling to onError.
  • Exports LoginButton as a withQueryProvider(...)-wrapped component so React Query hooks work when mounted via Astro (client:load).

@fhennig fhennig merged commit 5240710 into main Jul 15, 2026
12 checks passed
@fhennig fhennig deleted the fix/use-mutation-login-button branch July 15, 2026 08:41
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.

Refactor LoginButton to use useMutation for async sign-in

3 participants