Skip to content

chore: pass props down - #3670

Open
stevekaplan123 wants to merge 1 commit into
masterfrom
bug/sc-46560/web-reset-password-page-continue-with-google
Open

chore: pass props down#3670
stevekaplan123 wants to merge 1 commit into
masterfrom
bug/sc-46560/web-reset-password-page-continue-with-google

Conversation

@stevekaplan123

@stevekaplan123 stevekaplan123 commented Aug 30, 2026

Copy link
Copy Markdown
Member

Description

On the Forgot password screen, entering an email that belongs to a Google-only or Apple-only account shows an error banner with "Continue with Google" / "Continue with Apple" links — but those links did nothing.

Every other view in the auth flow receives three helper props from AuthPage that make those provider links work. ForgotView was the only view that wasn't given them, so the banner rendered but had nothing wired behind it. The Google link had no element for the real Google button to mount into, and the Apple link's onClick called an undefined function. This PR passes those three props down to ForgotView.

Code Changes

static/js/auth/AuthPage.jsx — Pass registerGoogleTarget, triggerApple, and setActiveErrorHandler into <ForgotView>, matching what the other views already receive.

static/js/auth/ForgotView.jsx — Accept the three props, forward them to FormView, and add them to propTypes. FormView already knows what to do with them (static/js/auth/FormView.jsx lines 28–37); it just never got them from this view.

Prop What it does
registerGoogleTarget Tells the real Google sign-in button which DOM element to render into
triggerApple The function the Apple link calls when clicked
setActiveErrorHandler Routes errors that arrive after the sign-in popup opens back to this view, instead of a different screen

static/js/auth/tests/ForgotView.test.js — New file, 3 tests, one per prop:

  • the banner's Google link is registered as the portal target for the real Google button
  • clicking the banner's Apple link fires triggerApple
  • the view registers its error handler on mount and clears it on unmount

@stevekaplan123
stevekaplan123 marked this pull request as ready for review August 30, 2026 10:58
@gitvelocity-reviewer

Copy link
Copy Markdown

📊 Code Quality Score: 13/100

Base Score 33 × ESF 0.4 = 13.2 → 13

Category Score Factors
🔭 Scope 8/20 AuthPage.jsx gains two prop lines; ForgotView.jsx adds three props to its signature and forwards them to FormView; ForgotView.test.js is a new file. All three files are within the auth subsystem. No new endpoints, no new public API surface, no config changes.
🏗️ Architecture 3/20 ForgotView now participates in the same SSO provider prop contract that other auth views already implement. No new module boundary, no new dependency — the change aligns ForgotView with an existing pattern rather than introducing one.
⚙️ Implementation 4/20 AuthPage.jsx adds two prop attributes to the ForgotView JSX element. ForgotView.jsx destructures three optional props and passes them through to FormView. The logic is prop-threading with no branching or state.
⚠️ Risk 4/20 The three new props are optional and only activate on the sso_only_account error path, so the normal forgot-password flow is unchanged. A regression would surface as inert SSO links on the forgot-password screen — the same broken state that existed before this fix. No migration, no schema change, no auth contract change.
✅ Quality 12/15 ForgotView.test.js adds three tests: Google portal target registration after an SSO-only reset response, Apple link click firing triggerApple, and setActiveErrorHandler called on mount and cleared on unmount. mockSsoOnlyReset mirrors the actual sso/views.py response shape. The comment block in ForgotView.jsx names the error code and the downstream component. No test drives the AuthPage.jsx prop-threading line directly.
🔒 Perf / Security 2/5 No performance work. The change touches the SSO auth path — the props wired here (registerGoogleTarget, triggerApple) are the same OAuth trigger mechanisms used by other views, so no new permission surface is introduced.

Was this score accurate? 👍 Yes · 👎 No

How this was scored →

Scored by GitVelocity · How are scores calculated?

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.

2 participants