fix(license-wall): hide on logout + auth routes, clear stale block state#278
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
A user with no license/trial who clicks Logout still sees the 'License Required' modal covering the
/loginpage (screenshot in thread). Logging out should dismiss it.Causes
reason, never reset it. On logouttoken→ null, the effect early-returned, and the stalereason='no-license'kept the modal mounted over the login page./login(and the other auth routes) weren't exempt — only/settings/licensewas.Fix
reasonto 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)./login,/verify-email,/forgot-password,/reset-password,/accept-invitein addition to/settings/license.!tokendirectly so a render race can't flash the modal.Test plan