Skip to content

fix(auth): restore Google sign-in retry state - #1995

Closed
groupthinking wants to merge 1 commit into
mainfrom
fix/google-signin-retry-state
Closed

groupthinking wants to merge 1 commit into
mainfrom
fix/google-signin-retry-state

Conversation

@groupthinking

Copy link
Copy Markdown
Owner

Canonical issue

Closes #1987

Outcome

Users can retry Google sign-in after initiation rejects or returns without beginning navigation. The button remains disabled during an actual in-flight handoff, including synchronous duplicate clicks.

Scope

  • Included: client-side retry recovery and accessible, fixed non-sensitive error state in GoogleSignInButton; focused jsdom component tests for rejected initiation, fulfilled-without-navigation initiation, and navigation-handoff duplicate-click prevention.
  • Explicitly excluded: callback-path sanitization, public auth-route behavior, OAuth provider configuration, credentials, deployment configuration, payment behavior, proxy policy, Origin G.A.T.E., and workflow changes.

Risk

  • Risk level: medium (authentication UI behavior)
  • Failure mode: an unusual provider handoff that changes the URL after the sign-in promise settles could retain the loading state until navigation completes.
  • Rollback: revert commit 81fc601a1ea7a3b5b73d200cd0f30702432d3cf6.

Verification

Verified locally on head 81fc601a1ea7a3b5b73d200cd0f30702432d3cf6:

  • Focused tests: npm run test -- src/app/login/GoogleSignInButton.test.tsx src/lib/__tests__/auth-paths.test.ts src/lib/__tests__/auth-config-source.test.ts src/__tests__/proxy-auth-gate.test.ts — 44 passing tests.
  • Full web suite: npm run test — 128 test files passed; 1,213 tests passed; 27 skipped.
  • Type check: npm run type-check — exit 0.
  • Lint: npm run lint — exit 0 with three existing internal-navigation warnings in OneLoopStudio.tsx and VideoWorkflowStudio.tsx; none originate from this change.
  • Production web build: npm run build:web — exit 0.
  • Live HTTP E2E: npx vitest run tests/e2e/pipeline.test.ts — 17 passing tests against the configured public target; this suite does not cover the Google login button.
  • Browser login E2E: not available in the repository. Playwright config has only Chromium and no login scenario. The configured Chromium smoke suite was run but failed one unrelated production assertion because getByText('$39') now matches four elements; its remaining tests did not exercise /login.
  • Required CI and review threads.

Production evidence

Not applicable at PR creation. This is a draft; no deployment, preview creation, merge, or production change was initiated. No protected-preview E2E was run because preview credentials were unavailable in this environment.

Agent handoff

  • One canonical issue is linked.
  • No competing PR implements the same issue. Existing draft PR fix(auth): restore Google sign-in retry state #1988 overlaps but also changes unrelated files and unconditionally clears the loading state after a fulfilled sign-in; this draft is intentionally restricted to [Agent] Restore Google login retry state #1987's declared two-file scope and preserves navigation handoff locking.
  • Local acceptance criteria are covered by focused component tests.
  • Required checks pass on the current head.
  • Individual human approval is required before merging this authentication UI change.

@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
v0-uvai Canceled Canceled v0 Sep 17, 2026 5:10am UTC

@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: groupthinking/EventRelay/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: cfd92345-773c-46f3-8492-ef22c3c6b25d


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added javascript Pull requests that update javascript code tests labels Sep 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 81fc601.
Ensure that dependencies are being submitted on PR branches. Re-running this action after a short time may resolve the issue. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@groupthinking
groupthinking marked this pull request as ready for review September 18, 2026 20:58
Copilot AI balanced review requested due to automatic review settings September 18, 2026 20:58

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Pull request overview

Restores retry capability for Google sign-in when initiation fails or completes without triggering navigation, while keeping the button disabled during genuine in-flight navigation handoff.

Changes:

  • Add in-flight guarding + retryable error state to GoogleSignInButton.
  • Display an accessible error message for initiation failures / non-navigation resolutions.
  • Add focused jsdom tests covering rejection, resolve-without-navigation, and duplicate-click prevention.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
apps/web/src/app/login/GoogleSignInButton.tsx Adds ref-based in-flight lock, retry recovery, and alert error UI for failed/non-navigating sign-in initiation.
apps/web/src/app/login/GoogleSignInButton.test.tsx Adds component tests validating retry behavior and duplicate-click prevention across navigation edge cases.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +26 to +39
try {
await signIn('google', { callbackUrl });

if (window.location.href === initialLocation) {
setError(SIGN_IN_INITIATION_ERROR);
setIsSubmitting(false);
signInInFlight.current = false;
}
} catch {
if (window.location.href === initialLocation) {
setError(SIGN_IN_INITIATION_ERROR);
setIsSubmitting(false);
signInInFlight.current = false;
}
{isSubmitting ? 'Redirecting to Google…' : 'Continue with Google'}
</button>
{error ? (
<p role="alert" className="mt-3 text-sm text-red-300">
vi.mock('next-auth/react', () => ({ signIn: vi.fn() }));

const callbackUrl = '/studio?video=https://www.youtube.com/watch?v=auJzb1D-fag';
const genericError = 'We couldn’t start Google sign-in. Please try again.';
Comment on lines +23 to +30
function renderButton() {
render(<GoogleSignInButton callbackUrl={callbackUrl} />);
return screen.getByRole('button', { name: 'Continue with Google' }) as HTMLButtonElement;
}

function getRetryButton() {
return screen.getByRole('button', { name: 'Continue with Google' }) as HTMLButtonElement;
}
@kk-agent

Copy link
Copy Markdown
Collaborator

AXIOM keep-moving: closing as duplicate/conflicted of GoogleSignInButton retry work. Survivor: #1984 (mergeable).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Agent] Restore Google login retry state

3 participants