Skip to content

fix(auth): remove login gate for all visitors#3115

Merged
koala73 merged 1 commit into
mainfrom
fix/remove-login-gate
Apr 17, 2026
Merged

fix(auth): remove login gate for all visitors#3115
koala73 merged 1 commit into
mainfrom
fix/remove-login-gate

Conversation

@SebastienMelki

Copy link
Copy Markdown
Collaborator

Summary

  • Removes the isProUser() guard around setupAuthWidget() in src/App.ts so the Sign In button is visible to all visitors, not just users with legacy API keys
  • Removes the matching localStorage gate around the pricing section in pro-test/src/App.tsx
  • Resolves the bootstrapping deadlock documented in todo Use aircraft typecode to refine military flight typing #34

Per @koala73's request — time to remove the blocker and let everyone sign in.

Test plan

  • Open the app in a fresh browser (no localStorage keys) — Sign In button should appear in the header
  • Clicking Sign In opens the Clerk auth modal
  • After signing in, pro features work as expected
  • Visit the /pro landing page — pricing section is visible without legacy keys

🤖 Generated with Claude Code

The setupAuthWidget() call was gated behind isProUser(), which created
a deadlock: new users without legacy API keys could never see the
Sign In button and thus could never authenticate. Removes the guard
in both the main app and the pro landing page pricing section.

Closes #34

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@vercel

vercel Bot commented Apr 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
worldmonitor Ignored Ignored Apr 15, 2026 4:57pm

Request Review

@greptile-apps

greptile-apps Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR resolves the bootstrapping deadlock documented in todo #34 by removing the isProUser() guard around setupAuthWidget() in src/App.ts (so the Sign In button mounts for all visitors) and removing the localStorage gate hiding PricingSection/PricingTable in the pro landing page. The initAuthState() guard had already been removed in a prior change; this PR completes the fix.

Confidence Score: 5/5

Safe to merge — targeted two-line removal with no new logic introduced and correct sequencing preserved.

All three changed files are straightforward removals of intentional-but-outdated guards. The setupAuthWidget() call is correctly positioned before resumePendingCheckout so authModal is available when needed. No new code paths, no regressions identified. All findings are P2 or lower.

No files require special attention.

Important Files Changed

Filename Overview
src/App.ts Removes if (isProUser()) guard around setupAuthWidget() — now always called, ensuring authModal is set before the downstream resumePendingCheckout reference at line 978.
pro-test/src/App.tsx Removes localStorage gate that hid PricingSection / PricingTable from users without legacy API keys; both components now render unconditionally for all visitors.
todos/034-pending-p1-auth-init-gated-behind-isProUser-deadlock.md Status updated from pending to done; accurately reflects that both auth-init guards have now been removed across two PRs.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[App.init] --> B[initAuthState - unconditional]
    B --> C[setupUnifiedSettings]
    C --> D_NEW["setupAuthWidget (unconditional — this PR)"]
    D_NEW --> E[authModal set on ctx]
    E --> F[capturePendingCheckoutIntentFromUrl]
    F --> G{pendingCheckout?}
    G -- yes --> H["resumePendingCheckout\n(authModal.open available ✓)"]
    G -- no --> I[Continue init]

    subgraph Before this PR
        D_OLD["if isProUser():\n  setupAuthWidget()"]
        D_OLD_FALSE["New user → authModal = undefined\nSign In button never mounts\nCheckout silently broken"]
    end
Loading

Reviews (1): Last reviewed commit: "fix(auth): remove isProUser() gate so al..." | Re-trigger Greptile

@SebastienMelki

Copy link
Copy Markdown
Collaborator Author

@koala73 — this PR removes the login gate as you asked. Before merging, we want to also have the API key management UI ready so users who sign in can create their own keys.

Here's the plan and the order we're thinking:

  1. This PR (fix(auth): remove login gate for all visitors #3115) — remove the login gate (done, ready to merge)
  2. feat(auth): user-facing API key management (create / list / revoke) #3116 — API key management — let users create/list/revoke their own API keys + enforce the per-tier rate limits that already exist in entitlements
  3. feat(billing): usage-based metered billing for API calls via Dodo #3117 — Metered billing — usage-based billing via Dodo for API calls (overage charges, usage dashboards, etc.)

We could either:

  • Ship 1 + 2 together — open login and let users self-serve keys on the existing flat-rate plans, then add metered billing later
  • Wait for all 3 — ship everything at once so billing is airtight from day one

What's your preference on priority? Is flat-rate enough to start, or do you want metered billing before opening the gates?

🤖 Generated with Claude Code

@koala73

koala73 commented Apr 16, 2026

Copy link
Copy Markdown
Owner

@SebastienMelki thanks. We can start with 1 + 2, before rolling 3 - which is the ideal scenario
But we need feedback, hence I wouldn't mind if we launch without 3

@SebastienMelki

Copy link
Copy Markdown
Collaborator Author

@koala73 — API key management is now ready in #3125. Here's the full picture:

  1. fix(auth): remove login gate for all visitors #3115 (this PR) — removes the login gate so all visitors see Sign In
  2. feat(auth): user-facing API key management (create / list / revoke) #3125 — lets signed-in users create/manage their own API keys from Settings
  3. feat(billing): usage-based metered billing for API calls via Dodo #3117 — metered billing (future, not blocking)

Per your earlier feedback, 1 + 2 are good to ship without 3. Want to merge these in order (this one first, then #3125), or should we wait for anything else?

@koala73
koala73 merged commit 72e3e3e into main Apr 17, 2026
12 checks passed
@koala73
koala73 deleted the fix/remove-login-gate branch April 17, 2026 15:08
koala73 added a commit that referenced this pull request Apr 17, 2026
PR #3115 removed the isProUser() localStorage gate from pro-test/src/App.tsx
that hid PricingSection + PricingTable behind `wm-widget-key` / `wm-pro-key`,
but the compiled bundle under public/pro/assets/ (the static bundle served
at worldmonitor.app/pro) was never rebuilt. Visitors without legacy API
keys in localStorage therefore still see no prices and no path into the
normal Clerk sign-in that the PricingSection CTAs trigger.

Rebuilding the bundle drops the gate check (grep count goes from 1 to 0)
and rewires the index.html asset hashes.
koala73 added a commit that referenced this pull request Apr 17, 2026
…ps (#3148)

PR #3115 removed the isProUser() localStorage gate from pro-test/src/App.tsx
that hid PricingSection + PricingTable behind `wm-widget-key` / `wm-pro-key`,
but the compiled bundle under public/pro/assets/ (the static bundle served
at worldmonitor.app/pro) was never rebuilt. Visitors without legacy API
keys in localStorage therefore still see no prices and no path into the
normal Clerk sign-in that the PricingSection CTAs trigger.

Rebuilding the bundle drops the gate check (grep count goes from 1 to 0)
and rewires the index.html asset hashes.
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