fix: handle undefined user object in LandingScreen for non-existent cloud billing domains #40855
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.
Problem
With the introduction of cloud billing and multi-organization support, users can now access Appsmith through organization-specific subdomains (e.g.,
testorg.appsmith.com
). However, when users attempt to access non-existent domains (e.g.,domaindoesnotexist.appsmith.com
), the system fails to return a user object, causing the application to get stuck in an infinite loading state.🔍 Root Cause
The issue was in the
LandingScreen
component's conditional logic:The problem: When accessing a non-existent domain,
props.user
isnull
/undefined
, causing the conditionprops.user && window.location.pathname === BASE_URL
to evaluate tofalse
. This prevented the redirect logic from executing, leaving users on a perpetual loading screen instead of being properly redirected to the login page.✅ Solution
Updated the conditional logic to handle cases where the user object is undefined:
Key changes:
props.user &&
guard condition - Now the redirect logic always executes when on the base URL!props.user || props.user.email === ANONYMOUS_USERNAME
properly handles both scenarios:📊 Impact
🧪 Testing Scenarios
This fix addresses the following scenarios in the cloud billing multi-org environment:
Automation
/ok-to-test tags="@tag.Authentication, @tag.Sanity"
🔍 Cypress test results
Tip
🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
Workflow run: https://github.com/appsmithorg/appsmith/actions/runs/15438685266
Commit: afee6b1
Cypress dashboard.
Tags:
@tag.Authentication, @tag.Sanity
Spec:
Wed, 04 Jun 2025 10:09:08 UTC
Communication
Should the DevRel and Marketing teams inform users about this change?
Summary by CodeRabbit