Skip to content

fix(auth): name a Google user who was already signed up - #4

Merged
bgard68 merged 1 commit into
mainfrom
fix/google-returning-user-name
Oct 8, 2026
Merged

bgard68 merged 1 commit into
mainfrom
fix/google-returning-user-name

Conversation

@bgard68

@bgard68 bgard68 commented Oct 8, 2026

Copy link
Copy Markdown
Owner

Signing in with Google still showed "Hello, there".

The name capture I added covered two paths — creating an account, and linking Google to an existing one. Both live inside if (user is null). A returning Google user is found by google_sub and skips that block entirely, so every Google account that existed before the change stayed nameless.

Permanently, too. Unlike a local account there is nowhere to fix it: a Google-only account never sees a password section, and the profile page does not ask for a name twice.

Now filled on the returning path under the same rule as the other two — only when the account has none, so a name someone chose is never replaced by their Google profile.

The branch is guarded on both the name being absent and Google actually supplying one, so an ordinary sign-in issues no write at all. That is deliberate: it runs on every Google login against a database billed by the minute it is awake, and writing null over null would wake it for nothing. The fake repository now counts writes so that is asserted rather than assumed.

Red path confirmed — disabling the new branch fails the test.

gate result
Unit / Integration / API 506 / 111 / 148 pass
dotnet format, Release -warnaserror clean

🤖 Generated with Claude Code

Signing in with Google still showed "Hello, there". Capturing the profile name
covered creating an account and linking Google to an existing one, and missed
the case that applies to everyone who had used the button before: a returning
user is found by google_sub, which skips both of those branches outright. So
every Google account predating the change stayed nameless, permanently — and
unlike a local account there is nowhere to fix it, because a Google-only
account never sees a password section and the profile page does not ask for a
name twice.

Filled on the returning path too, under the same rule as the other two: only
when the account has none, so a name someone chose is never replaced by their
Google profile.

Guarded on both the name being absent and Google actually supplying one, so an
ordinary sign-in issues no write at all. That is deliberate rather than tidy:
this runs on every Google login against a database billed by the minute it is
awake, and a write that stores null over null would wake it for nothing.

The fake user repository now counts writes so that can be asserted rather than
assumed. Confirmed red-path: disabling the new branch fails the test.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bgard68
bgard68 merged commit 8f55c2c into main Oct 8, 2026
9 checks passed
@bgard68
bgard68 deleted the fix/google-returning-user-name branch October 8, 2026 01:02
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