Skip to content

fix(license-wall): hide on logout + auth routes, clear stale block state#278

Merged
keysersoft merged 1 commit into
mainfrom
fix/license-wall-logout
May 30, 2026
Merged

fix(license-wall): hide on logout + auth routes, clear stale block state#278
keysersoft merged 1 commit into
mainfrom
fix/license-wall-logout

Conversation

@keysersoft
Copy link
Copy Markdown
Contributor

Bug

A user with no license/trial who clicks Logout still sees the 'License Required' modal covering the /login page (screenshot in thread). Logging out should dismiss it.

Causes

  1. The effect only ever set reason, never reset it. On logout token → null, the effect early-returned, and the stale reason='no-license' kept the modal mounted over the login page.
  2. /login (and the other auth routes) weren't exempt — only /settings/license was.

Fix

  • Reset reason to null when !token, on the active-license path, and on the self-host-no-plan path (so stale blocks can't linger across logout / org-switch / re-auth).
  • Exempt /login, /verify-email, /forgot-password, /reset-password, /accept-invite in addition to /settings/license.
  • Guard short-circuits on !token directly so a render race can't flash the modal.

Test plan

  • frontend tsc (license-wall clean)
  • After deploy: log in as a no-license cloud user → wall shows on dashboard → click Logout → lands on /login with NO modal
  • /settings/license still reachable to enter a key / start trial

The LicenseWall modal kept covering the /login page after a user with
no license/trial clicked Logout. Two causes:

1. The effect only ever *set* `reason`, never reset it. On logout
   `token` goes null, the effect early-returned, and the stale
   `reason='no-license'` kept the modal mounted on top of the login
   page. Now `!token` resets reason to null. Also reset it on the
   active-license and self-host-no-plan paths so a stale block from a
   previous session can't linger after switching orgs / re-auth.

2. `/login` (and the other unauthenticated auth routes) weren't in the
   exempt list — only /settings/license was. You can't resolve a
   license problem while logged out, so the wall has no business
   rendering there. Added /login, /verify-email, /forgot-password,
   /reset-password, /accept-invite to the exemption.

Guard now also short-circuits on `!token` directly so even a render
race (reason set, token cleared in same tick) can't flash the modal.
@keysersoft keysersoft requested a review from mirkopoloni as a code owner May 30, 2026 13:24
@keysersoft keysersoft enabled auto-merge (squash) May 30, 2026 13:24
@keysersoft keysersoft merged commit 841ad1e into main May 30, 2026
11 checks passed
@keysersoft keysersoft deleted the fix/license-wall-logout branch May 30, 2026 13:26
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