Skip to content

Integrate extraFields for guest auth - #2833

Merged
nezaj merged 3 commits into
mainfrom
extra-fields-guest-auth
Aug 4, 2026
Merged

Integrate extraFields for guest auth#2833
nezaj merged 3 commits into
mainfrom
extra-fields-guest-auth

Conversation

@nezaj

@nezaj nezaj commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Got a request for integrating extraFields into guest auth and it was pretty straightforward!

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bba03bab-8512-472a-9806-34581c0caea4

📥 Commits

Reviewing files that changed from the base of the PR and between 8240c0f and cb10dc9.

📒 Files selected for processing (2)
  • client/packages/core/__tests__/src/auth-extra-fields.e2e.test.ts
  • client/packages/version/src/version.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • client/packages/core/tests/src/auth-extra-fields.e2e.test.ts

📝 Walkthrough

Walkthrough

Guest authentication now accepts optional extraFields. The client API forwards these fields through the reactor and authentication layers. Runtime and admin routes validate extra fields and persist them on guest users. Tests verify field persistence and $users create-rule enforcement. Documentation describes the feature and schema requirements.

Changes

Guest authentication extra fields

Layer / File(s) Summary
Server guest creation and validation
server/src/instant/runtime/routes.clj, server/src/instant/admin/routes.clj, server/test/instant/runtime/routes_test.clj
Runtime and admin guest sign-in routes read optional extra-fields from requests, validate them, and persist them on guest users. Test helpers support optional request bodies. Tests verify field persistence and enforce $users create-rule requirements.
Client API and documentation wiring
client/packages/core/src/authAPI.ts, client/packages/core/src/Reactor.js, client/packages/core/src/index.ts, client/packages/core/__tests__/src/auth-extra-fields.e2e.test.ts, client/www/app/docs/auth/guest-auth/page.md, client/www/app/docs/users/page.md
The public client API accepts optional extraFields in a SignInAsGuestParams type and forwards them through the reactor and auth API. Commented end-to-end test coverage and documentation describe guest extra fields and $users schema requirements.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ClientAuth
  participant ClientAuthAPI
  participant GuestSignInRoute
  participant Validator
  participant UserStore
  ClientAuth->>ClientAuthAPI: signInAsGuest with extraFields
  ClientAuthAPI->>GuestSignInRoute: POST with extra-fields
  GuestSignInRoute->>Validator: Validate extra-fields against $users schema
  Validator->>UserStore: Create guest with extra-fields
  UserStore-->>ClientAuth: Return guest identity
Loading

Possibly related PRs

Suggested reviewers: stopachka

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: integrating extraFields functionality into guest authentication across client and server components.
Description check ✅ Passed The description relates to the changeset by acknowledging the extraFields feature request and implementation, though it lacks technical detail about what was changed.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch extra-fields-guest-auth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stopachka stopachka 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.

SGTM!

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Caution

Failed to replace (edit) comment. This is likely due to insufficient permissions or the comment being deleted.

Error details
putComment timed out

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@client/www/app/docs/users/page.md`:
- Around line 183-190: Update the authentication response documentation near the
Guest auth example to qualify the claim that all sign-in methods return a
created field, excluding signInAsGuest from that statement unless its
VerifyResponse is changed to include created: true. Preserve the existing guest
sign-in example and document its actual response shape.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 23ef3f1a-469d-4680-a7f0-f2c1294cf6b4

📥 Commits

Reviewing files that changed from the base of the PR and between fa8ca89 and 8240c0f.

📒 Files selected for processing (9)
  • client/packages/core/__tests__/src/auth-extra-fields.e2e.test.ts
  • client/packages/core/src/Reactor.js
  • client/packages/core/src/authAPI.ts
  • client/packages/core/src/index.ts
  • client/www/app/docs/auth/guest-auth/page.md
  • client/www/app/docs/users/page.md
  • server/src/instant/admin/routes.clj
  • server/src/instant/runtime/routes.clj
  • server/test/instant/runtime/routes_test.clj

Comment thread client/www/app/docs/users/page.md
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

View Vercel preview at instant-www-js-extra-fields-guest-auth-jsv.vercel.app.

@nezaj
nezaj merged commit 676c4fd into main Aug 4, 2026
30 checks passed
@nezaj
nezaj deleted the extra-fields-guest-auth branch August 4, 2026 17:07
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.

2 participants