Skip to content

Add extensible user registration flow - #170

Merged
goshacodes merged 3 commits into
mainfrom
feat/user-registration
Aug 15, 2026
Merged

Add extensible user registration flow#170
goshacodes merged 3 commits into
mainfrom
feat/user-registration

Conversation

@goshacodes

@goshacodes goshacodes commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds an extensible per-client registration flow (RegistrationFlow / RegistrationStep) with ordered OTP, Password, and Passkey steps and room for future step types.
  • Adds phone/email registration entry to the credential form while preserving sign-in. Existing credentials silently continue through sign-in to avoid account enumeration.
  • Keeps Central as the canonical user index: before creating an Auth user, Auth synchronously claims an idempotent user ID from Central through POST /users/registrations.
  • Handles registration claims atomically in Central, including concurrent claims and conflicting credentials, and uses the existing Central-to-Auth user outbox for convergence.
  • Creates the Auth user and assigns registration roles in one repository transaction after the Central claim succeeds.
  • Places the internal registration-claim endpoint in UserController at POST /users/registrations.
  • Adds registration_flow to Central OAuth clients (V1018) and snapshots the flow and current step in Auth conversations (V0011). No Auth registration-outbox migration is required.
  • Applies Patch[T] semantics to authFlow, registrationFlow, frontChannelLogoutUri, and backChannelLogoutUri, distinguishing absent, explicit null, and set values.
  • Validates registration-flow configuration and updates Central UI client configuration and credential-form rendering.
  • Seeds the default registration user role and consolidates Auth role persistence into UserRepository.
  • Adds unit, repository, controller, concurrency, and e2e registration coverage.

Testing

  • sbt "central/test" — 313 tests passed, 0 failed.
  • sbt "auth/test" — 709 tests passed, 0 failed.
  • sbt "central-postgres-impl/compile" — passed.
  • RegistrationFlowSpec covers phone/email registration, configured registration steps, and existing-user fallback. Running it locally requires generated form assets and a freshly seeded live stack.

Pull Request opened by Augment Code | View session

- RegistrationFlow/RegistrationStep model in central and auth (OTP, SetPassword, PasskeyEnroll)
- registration_flow column on oauth_clients with InvalidRegistrationConfiguration validation
- Silent login for existing credentials during registration (anti-enumeration)
- User registration outbox to sync accounts from auth to central
- Patch[T] semantics for authFlow, registrationFlow, and logout URI configuration updates
- central-ui registration flow configuration UI
- e2e RegistrationFlowSpec
# Conflicts:
#	auth/src/main/scala/versola/oauth/authorize/AuthorizeEndpointService.scala
#	auth/src/main/scala/versola/oauth/conversation/ConversationRouter.scala
@goshacodes
goshacodes marked this pull request as ready for review August 13, 2026 18:35
@goshacodes

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread central-ui/forms/credential/credential.tsx Outdated

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 5 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread auth/src/main/scala/versola/user/UserService.scala Outdated
Comment thread central-ui/forms/credential/credential.tsx Outdated
@goshacodes
goshacodes force-pushed the feat/user-registration branch from 2704d46 to 3bd3a27 Compare August 15, 2026 10:01
@goshacodes

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment "augment review" and we will review it.

@goshacodes

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 3 suggestions posted.

Fix All in Augment

Items Reviewed
  • ✅ Registration flow routing and step advancement in ConversationRouter
  • ✅ Deferred account creation and OTP verification ordering
  • ✅ Central user-index claim (indexFromAuth) concurrency and conflict handling
  • ✅ Patch[T] semantics for authFlow/registrationFlow/logout URIs
  • ✅ Registration flow configuration validation in Central
  • ✅ Central UI client-form registration settings and API serialization
  • ✅ Auth OTP faking / account-enumeration behaviour
  • ✅ UserRolesRepository consolidation into UserRepository
  • ✅ Test coverage for new registration paths

Comment augment review to trigger a new review at any time.

Comment thread central-ui/src/components/client-form.ts Outdated
@goshacodes
goshacodes force-pushed the feat/user-registration branch from b97e0b7 to a01f01f Compare August 15, 2026 12:13
@goshacodes
goshacodes merged commit 246e6b7 into main Aug 15, 2026
6 checks passed
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