feat(auth): stamp profile_completed_at on Bunyip OIDC INSERT when both name claims arrive (MAPPS-329) #368
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-server!368
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/MAPPS-329-auto-populate-profile-from-bunyip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bunyip's BUNYIP-206 onboarding gate guarantees every fresh signup has first + last name populated BEFORE the user can reach any downstream app. upsert_user_from_oidc already used the given_name / family_name hints to seed the row, but it never set profile_completed_at, so the SPA's AuthGuard would still bounce the user to /onboarding/profile to re-type the same data Bunyip just collected. Stamp profile_completed_at = NOW() on the INSERT when both name claims came in non-empty so the SPA sees profile_completed = true from /auth/me and the user lands directly on the dashboard. Hints missing -> the row still seeds with the email-derived placeholder AND profile_completed_at stays NULL, so the existing fallback onboarding page kicks in for legacy / no-claim users. The ON CONFLICT UPDATE branch wraps the new value in COALESCE so a pre-existing timestamp survives the next login.
Adds two integration tests covering both branches (with-claims -> stamped, without-claims -> NULL).
#MAPPS-329