fix(onboarding): trigger /welcome for email + OAuth signups - #11
Merged
Conversation
The persona-based onboarding redirect was broken on two paths: 1. Email Register (controller/user.go:238) assigned `&settingStr` to `User.Setting` which is `string`, not `*string` — a Go compile error that prevented the backend from rebuilding, so new accounts never got persona="unset" stamped into their setting JSON. 2. OAuth signups (github/wechat/oidc/discord/linuxdo/telegram/oauth) created users with an empty Setting field, so PersonaPickerHost never saw the "unset" sentinel and never redirected them. Fixes: - controller/user.go: assign the marshaled JSON string directly. - model/user.go Insert(): when Setting is empty, seed persona="unset" so every OAuth path inherits the redirect for free. - PersonaPickerHost: was already converted from a blocking modal to a /welcome redirect (with loop guard for /welcome itself). - Welcome wizard: tolerate missing sessionStorage handoff — still render the 3-step picker if the user lands without the auto-login payload (e.g. OAuth, refresh after dismiss). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Onboarding redirect to
/welcomewas broken on two paths — fixes both.Bug 1 — Email Register never compiled
controller/user.go:238assigned&settingStr(a*string) toUser.Setting(declared asstringatmodel/user.go:50). That's a Go type mismatch — the backend couldn't rebuild, so new email signups never gotpersona="unset"stamped into their setting JSON, soPersonaPickerHostnever saw the sentinel, so/welcomenever opened.Fix: assign the marshaled JSON string directly.
Bug 2 — OAuth signups had no persona seed
User.Insert()initializes an emptydto.UserSetting{}whenSetting == ""— this fires for every OAuth-created account (github / wechat / oidc / discord / linuxdo / telegram / generic oauth) because none of them pre-populate Setting before calling Insert. Withoutpersona="unset", those users skipped the wizard entirely.Fix: seed
dto.UserSetting{Persona: "unset"}in the empty-Setting branch. Single change covers all OAuth handlers automatically.Supporting frontend changes (already on this branch from prior work)
/welcomeredirect (not a blocking modal). One funnel for email + OAuth + legacy users.unsetuser.Test plan
bun run typecheck— already green/welcomewith 3-step wizard/welcome/welcome→ no redirect loopgo build ./...once Go is available on the merge machine🤖 Generated with Claude Code