Skip to content

Beta invite codes: 3 per new account, admin generation, console Invites + Admin - #44

Merged
ryuzdev merged 2 commits into
mainfrom
beta-invites
Oct 24, 2026
Merged

ryuzdev merged 2 commits into
mainfrom
beta-invites

Conversation

@ryuzdev

@ryuzdev ryuzdev commented Oct 24, 2026

Copy link
Copy Markdown
Member

Owner: "Console should have admin page for inviting via invite code. Each invited user should get 3 invites to share for beta. Admins should be able to generate codes." Contract: spec §6.5.1.

  • Codes OUTER-XXXX-XXXX (40 bits, OS CSPRNG, Crockford; input normalizes case, dashes, prefix, O→0, I/L→1). Single-use, invite_code table (migration 0002, append-only after the reset).
  • 3 per new account, minted in the account-creation transaction; admins (OUTER_ADMIN_EMAILS) get none and generate instead.
  • Redemption: sign_in (MCP), the OAuth sign-in page and the console sign-in take an optional invite code. A closed-beta email gets an email code only with a valid invite; the invite rides the verification row and is consumed when the email code is verified, in the transaction that creates the user (conditional UPDATE; a lost race creates nothing: "That invite code was just used."). An unverified email can't spend a code; invalid/used/revoked codes all get the same closed-beta answer (no oracle).
  • Console: ?t=invites (your codes, copy, status, who joined) and ?t=admin (generate 1–50 with a note, all codes with creator/redeemer, revoke unused, waitlist), from the rail account menu. Admin APIs are 403 for non-admins.
  • Docs: sign-in page gains an Invite codes section; tools reference regenerated.

Checks: 458 tests (grant counts, round trip, bad/used/revoked codes, double spend, allowlisted ignores the code, 403s, revoke rules, normalization). Security review (subagent): no bypass, race-safe, no enumeration oracle, admin checks server-side on every route, no XSS; one low note (an operator config change between send and verify still admits an allowlisted email) — accepted. Live (outer:e187767): admin and invites pages at 1440 and 390 px, no overflow, no console errors; generated 3 real codes through the page; an unknown email with a bogus code gets the closed-beta answer.

CodeRabbit is out of free reviews; merging on green CI plus the checks above.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 11 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d6a02806-9258-4cb1-a5f3-708ec1294207
Commits

Reviewing files that changed from the base of the PR and between f3d7eec and e187767.

Files selected for processing: 18
  • crates/outer/migrations/0002_invite_code.sql
  • crates/outer/src/auth/invites.rs
  • crates/outer/src/auth/mod.rs
  • crates/outer/src/auth/oauth.rs
  • crates/outer/src/auth/pages.rs
  • crates/outer/src/auth/tests.rs
  • crates/outer/src/http/console.rs
  • crates/outer/src/mcp/error.rs
  • crates/outer/src/mcp/registry.rs
  • crates/outer/src/mcp/tools/account.rs
  • web/docs/index.mdx
  • web/docs/reference/tools.md
  • web/docs/sign-in.mdx
  • web/pages/console/_islands/api.ts
  • web/pages/console/_islands/common.tsx
  • web/pages/console/_islands/console.tsx
  • web/pages/console/_islands/icons.tsx
  • web/pages/console/_islands/views.tsx
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@ryuzdev
ryuzdev merged commit cb493e2 into main Oct 24, 2026
4 checks passed
@ryuzdev
ryuzdev deleted the beta-invites branch October 24, 2026 16:54
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