fix(word-addin): keep the login page interactive during Google sign-in

↗ view on GitHub · Amal · 2026-08-21 · 40488660

WHY THIS MATTERS
Clicking "Continue with Google" replaced the entire task pane with the
bootstrap "Loading..." spinner for the lifetime of the OAuth dialog -
no explanation, no cancel, no way back to password login. On Word on
the web the dialog opens as a real browser popup that can land behind
the window or be blocked, leaving the pane indistinguishable from a
hung startup. The login page's own "Continuing..." button state was
dead code: it could never render because the page unmounted first.

WHAT WENT WRONG MECHANICALLY
signInWithGoogle set the store-wide `_loading` flag - the same flag
App.tsx uses for the one-time token bootstrap, checked BEFORE the
"no token -> LoginPage" branch. Setting it synchronously unmounted
LoginPage in the same React batch that tried to show the button
spinner.

HOW THE FIX WORKS
signInWithGoogle no longer touches `_loading`. The login page stays
mounted; its local googleLoading state (already wired) shows
"Continuing..." on the button and re-enables everything when the flow
resolves either way. Success still lands in writeSession, which
broadcasts the new token and swaps the pane to the app shell exactly
as before. This also removes the stuck-spinner path where a
superseded writeSession left `_loading` true forever with no error.

All 30 add-in auth e2e tests (chromium + webkit), including the five
Google OAuth scenarios, pass against this change.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RuPCULDYgVsiCanRgbEy6W
Repository open-legal-products/mike
Author Amal <mamalanand3@gmail.com>
Authored
Parents 6cb5260f
Stats 1 file changed , +5 , -3
Part of Add Google sign-in and personalised onboarding

Capture this commit into my fork

Download a Markdown prompt that tells Claude how to port this exact commit into your working tree. Run it via claude -p < capture-commit-40488660.md from inside the repo you want the change in.

⬇ Download capture-commit-40488660.md