fix: login domain redirect blocking to application (#40017)
## Description > [!TIP] > _Add a TL;DR when the description is longer than 500 words or extremely technical (helps the content, marketing, and DevRel team)._ > > _Please also include relevant motivation and context. List any dependencies that are required for this change. Add links to Notion, Figma or any other documents that might be relevant to the PR._ Fixes #`Issue Number` _or_ Fixes `Issue URL` > [!WARNING] > _If no issue exists, please create an issue first, and check with the maintainers if the issue is valid._ ## Automation /ok-to-test tags="@tag.Sanity" ### 🔍 Cypress test results <!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/14195152272> > Commit: cabf08853025dffdaaa5de33924e6d8fe9493c3d > <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=14195152272&attempt=1" target="_blank">Cypress dashboard</a>. > Tags: `@tag.Sanity` > Spec: > <hr>Tue, 01 Apr 2025 12:50:05 UTC <!-- end of auto-generated comment: Cypress test results --> ## Communication Should the DevRel and Marketing teams inform users about this change? - [ ] Yes - [ ] No <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved the post-signup flow by adjusting the redirection behavior based on whether the user is on the login page. - Introduced organizational context detection to ensure users are navigated to the appropriate destination after signup. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
parent
9e196f5724
commit
2c0e608946
|
|
@ -62,3 +62,6 @@ export const getHideWatermark = (state: AppState): boolean =>
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
export const isFreePlan = (state: AppState) => true;
|
export const isFreePlan = (state: AppState) => true;
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
export const isWithinAnOrganization = (state: AppState) => true;
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ export const redirectUserAfterSignup = (
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
dispatch?: any,
|
dispatch?: any,
|
||||||
isEnabledForCreateNew?: boolean, // is Enabled for only non-invited users
|
isEnabledForCreateNew?: boolean, // is Enabled for only non-invited users
|
||||||
|
isOnLoginPage?: boolean,
|
||||||
// TODO: Fix this the next time the file is edited
|
// TODO: Fix this the next time the file is edited
|
||||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
): any => {
|
): any => {
|
||||||
|
|
@ -100,7 +101,9 @@ export const redirectUserAfterSignup = (
|
||||||
error("Error handling the redirect url");
|
error("Error handling the redirect url");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
history.replace(APPLICATIONS_URL);
|
if (!isOnLoginPage) {
|
||||||
|
history.replace(APPLICATIONS_URL);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,10 @@ import { getCurrentUser } from "selectors/usersSelectors";
|
||||||
import UserWelcomeScreen from "pages/setup/UserWelcomeScreen";
|
import UserWelcomeScreen from "pages/setup/UserWelcomeScreen";
|
||||||
import { Center } from "pages/setup/common";
|
import { Center } from "pages/setup/common";
|
||||||
import { Spinner } from "@appsmith/ads";
|
import { Spinner } from "@appsmith/ads";
|
||||||
import { isValidLicense } from "ee/selectors/organizationSelectors";
|
import {
|
||||||
|
isValidLicense,
|
||||||
|
isWithinAnOrganization,
|
||||||
|
} from "ee/selectors/organizationSelectors";
|
||||||
import { redirectUserAfterSignup } from "ee/utils/signupHelpers";
|
import { redirectUserAfterSignup } from "ee/utils/signupHelpers";
|
||||||
import { setUserSignedUpFlag } from "utils/storage";
|
import { setUserSignedUpFlag } from "utils/storage";
|
||||||
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
|
import AnalyticsUtil from "ee/utils/AnalyticsUtil";
|
||||||
|
|
@ -22,6 +25,7 @@ export function SignupSuccess() {
|
||||||
);
|
);
|
||||||
const validLicense = useSelector(isValidLicense);
|
const validLicense = useSelector(isValidLicense);
|
||||||
const user = useSelector(getCurrentUser);
|
const user = useSelector(getCurrentUser);
|
||||||
|
const isOnLoginPage = !useSelector(isWithinAnOrganization);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
user?.email && setUserSignedUpFlag(user?.email);
|
user?.email && setUserSignedUpFlag(user?.email);
|
||||||
|
|
@ -37,8 +41,16 @@ export function SignupSuccess() {
|
||||||
validLicense,
|
validLicense,
|
||||||
dispatch,
|
dispatch,
|
||||||
isNonInvitedUser,
|
isNonInvitedUser,
|
||||||
|
isOnLoginPage,
|
||||||
),
|
),
|
||||||
[],
|
[
|
||||||
|
dispatch,
|
||||||
|
isNonInvitedUser,
|
||||||
|
isOnLoginPage,
|
||||||
|
redirectUrl,
|
||||||
|
shouldEnableFirstTimeUserOnboarding,
|
||||||
|
validLicense,
|
||||||
|
],
|
||||||
);
|
);
|
||||||
|
|
||||||
const onGetStarted = useCallback((proficiency?: string, useCase?: string) => {
|
const onGetStarted = useCallback((proficiency?: string, useCase?: string) => {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user