From 766e06d12ffea9b566c33f67a54a36f7ac209703 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Thu, 27 Mar 2025 01:04:35 +0530 Subject: [PATCH 1/7] feat: added global logout feature --- .../ActionExecution/ActionExecutionSagas.ts | 4 ++++ .../ce/utils/autocomplete/EntityDefinitions.ts | 9 +++++++++ .../ActionCreator/constants.ts | 1 + .../editorComponents/ActionCreator/utils.ts | 1 + app/client/src/workers/Evaluation/fns/index.ts | 9 ++++++++- .../src/workers/Evaluation/fns/logout.ts | 18 ++++++++++++++++++ 6 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 app/client/src/workers/Evaluation/fns/logout.ts diff --git a/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts b/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts index 577ed474c2d7..9b8de503c1a6 100644 --- a/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts +++ b/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts @@ -45,6 +45,7 @@ import type { ActionDescription } from "ee/workers/Evaluation/fns"; import type { AppState } from "ee/reducers"; import { getAction } from "ee/selectors/entitiesSelector"; import { getSourceFromTriggerMeta } from "ee/entities/AppsmithConsole/utils"; +import { logoutSaga } from "../userSagas"; export interface TriggerMeta { source?: TriggerSource; @@ -131,6 +132,9 @@ export function* executeActionTriggers( case "POST_MESSAGE": yield call(postMessageSaga, trigger); break; + case "LOGOUT_USER_INIT": + yield call(logoutSaga, trigger); + break; default: log.error("Trigger type unknown", trigger, source); throw Error("Trigger type unknown"); diff --git a/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts b/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts index a0a59b4f9cfd..59fd8eb109ba 100644 --- a/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts +++ b/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts @@ -276,6 +276,12 @@ export const GLOBAL_FUNCTIONS = { "Establish cross-origin communication between Window objects/page and iframes", "!type": "fn(message: unknown, source: string, targetOrigin: string)", }, + logoutUser: { + "!url": + "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/store-value", + "!doc": "Logout user", + "!type": "fn(redirectURL: string) -> void", + }, }; // TODO: Fix this the next time the file is edited @@ -329,6 +335,9 @@ export const ternDocsInfo: Record = { postWindowMessage: { exampleArgs: ["message, 'Iframe1', '*'"], }, + logoutUser: { + exampleArgs: ["url"], + }, }; export type EntityDefinitionsOptions = keyof typeof entityDefinitions; diff --git a/app/client/src/components/editorComponents/ActionCreator/constants.ts b/app/client/src/components/editorComponents/ActionCreator/constants.ts index 859e75217316..beb071bdba08 100644 --- a/app/client/src/components/editorComponents/ActionCreator/constants.ts +++ b/app/client/src/components/editorComponents/ActionCreator/constants.ts @@ -14,6 +14,7 @@ export enum APPSMITH_GLOBAL_FUNCTIONS { setInterval = "setInterval", clearInterval = "clearInterval", postWindowMessage = "postWindowMessage", + logoutUser = "logoutUser", } export enum APPSMITH_NAMESPACED_FUNCTIONS { diff --git a/app/client/src/components/editorComponents/ActionCreator/utils.ts b/app/client/src/components/editorComponents/ActionCreator/utils.ts index 91464ffb567e..01c4e315948d 100644 --- a/app/client/src/components/editorComponents/ActionCreator/utils.ts +++ b/app/client/src/components/editorComponents/ActionCreator/utils.ts @@ -460,6 +460,7 @@ export const chainableFns: TActionBlock["actionType"][] = [ AppsmithFunction.resetWidget, AppsmithFunction.showModal, AppsmithFunction.download, + AppsmithFunction.logoutUser, ]; export function actionToCode( diff --git a/app/client/src/workers/Evaluation/fns/index.ts b/app/client/src/workers/Evaluation/fns/index.ts index a932688c11ca..16a17a12bd8d 100644 --- a/app/client/src/workers/Evaluation/fns/index.ts +++ b/app/client/src/workers/Evaluation/fns/index.ts @@ -60,6 +60,7 @@ import { } from "./geolocationFns"; import { getFnWithGuards, isAsyncGuard } from "./utils/fnGuard"; import { isRunNClearFnQualifierEntity } from "ee/workers/Evaluation/fns/utils/isRunNClearFnQualifierEntity"; +import { logoutUser, type TSLogoutActionType } from "./logout"; export const getPlatformFunctions = () => { return platformFns; @@ -114,6 +115,10 @@ const platformFns = [ name: "clearStore", fn: clearStore, }, + { + name: "logoutUser", + fn: logoutUser, + }, ]; const entityFns = [ @@ -215,6 +220,7 @@ const ActionTriggerFunctionNames: Record = { POST_MESSAGE: "postWindowMessage", SET_TIMEOUT: "setTimeout", CLEAR_TIMEOUT: "clearTimeout", + LOGOUT_USER_INIT: "logoutUser", }; export type ActionDescription = @@ -234,4 +240,5 @@ export type ActionDescription = | TCopyToClipboardDescription | TGetGeoLocationDescription | TWatchGeoLocationDescription - | TStopWatchGeoLocationDescription; + | TStopWatchGeoLocationDescription + | TSLogoutActionType; diff --git a/app/client/src/workers/Evaluation/fns/logout.ts b/app/client/src/workers/Evaluation/fns/logout.ts new file mode 100644 index 000000000000..6ffdbe00c9eb --- /dev/null +++ b/app/client/src/workers/Evaluation/fns/logout.ts @@ -0,0 +1,18 @@ +import { promisify } from "./utils/Promisify"; + +function logoutFnDescriptor(redirectURL: string) { + return { + type: "LOGOUT_USER_INIT" as const, + payload: { + redirectURL, + }, + }; +} + +export type TSLogoutActionType = ReturnType; + +export async function logoutUser( + ...args: Parameters +) { + return promisify(logoutFnDescriptor)(...args); +} From 709a3d0195863f3e47887edb863720f70db51707 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Fri, 28 Mar 2025 19:36:22 +0530 Subject: [PATCH 2/7] feat: added login page redirection, with redirect url instead of full path --- .../sagas/ActionExecution/ActionExecutionSagas.ts | 4 ++-- app/client/src/ce/sagas/userSagas.tsx | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts b/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts index 9b8de503c1a6..12acb63054d8 100644 --- a/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts +++ b/app/client/src/ce/sagas/ActionExecution/ActionExecutionSagas.ts @@ -45,7 +45,7 @@ import type { ActionDescription } from "ee/workers/Evaluation/fns"; import type { AppState } from "ee/reducers"; import { getAction } from "ee/selectors/entitiesSelector"; import { getSourceFromTriggerMeta } from "ee/entities/AppsmithConsole/utils"; -import { logoutSaga } from "../userSagas"; +import { globalFunctionLogoutUser } from "../userSagas"; export interface TriggerMeta { source?: TriggerSource; @@ -133,7 +133,7 @@ export function* executeActionTriggers( yield call(postMessageSaga, trigger); break; case "LOGOUT_USER_INIT": - yield call(logoutSaga, trigger); + yield call(globalFunctionLogoutUser, trigger); break; default: log.error("Trigger type unknown", trigger, source); diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx index fd0a01fd4e44..24aceff6e035 100644 --- a/app/client/src/ce/sagas/userSagas.tsx +++ b/app/client/src/ce/sagas/userSagas.tsx @@ -724,3 +724,16 @@ export const setMessageConfig = (id: string, config: ProductAlertConfig) => { JSON.stringify(updatedConfig), ); }; + +export function* globalFunctionLogoutUser( + action: ReduxAction<{ redirectURL: string }>, +) { + const redirectURL = `${AUTH_LOGIN_URL}${action.payload?.redirectURL ? "?redirectUrl=" + action.payload?.redirectURL : ""}`; + + yield call(logoutSaga, { + type: ReduxActionTypes.LOGOUT_USER_INIT, + payload: { + redirectURL, + }, + }); +} From 7e2de4c97e6a97bac659d6c40823c78c8d2cbdc4 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Fri, 28 Mar 2025 19:38:14 +0530 Subject: [PATCH 3/7] feat: update the documentation link --- app/client/src/ce/utils/autocomplete/EntityDefinitions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts b/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts index 59fd8eb109ba..5e0864957b14 100644 --- a/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts +++ b/app/client/src/ce/utils/autocomplete/EntityDefinitions.ts @@ -278,7 +278,7 @@ export const GLOBAL_FUNCTIONS = { }, logoutUser: { "!url": - "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/store-value", + "https://docs.appsmith.com/reference/appsmith-framework/widget-actions/logout-user", "!doc": "Logout user", "!type": "fn(redirectURL: string) -> void", }, From c67153129f4c001d8c8a89a8d4c40126080f2991 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Mon, 31 Mar 2025 17:01:23 +0530 Subject: [PATCH 4/7] feat: global logout in action selector, cypress test case, jest test case --- .../ActionSelector_JsToNonJSMode_4_spec.ts | 20 ++++++++++++++++++- app/client/src/ce/constants/messages.ts | 1 + .../FieldGroup/FieldGroupConfig.test.ts | 16 +++++++++++++++ .../FieldGroup/FieldGroupConfig.ts | 7 +++++++ .../viewComponents/ActionBlockTree/utils.tsx | 8 ++++++++ 5 files changed, 51 insertions(+), 1 deletion(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts index b4af0af94357..4460ab4349b7 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts @@ -15,7 +15,7 @@ describe( agHelper.AddDsl("promisesBtnDsl", locators._buttonByText("Submit")); }); - it("10. Bug 23167 - Message field in PostMessage should accept all type of values", () => { + it("1. Bug 23167 - Message field in PostMessage should accept all type of values", () => { EditorNavigation.SelectEntityByName("Page1", EntityType.Page); EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); @@ -53,5 +53,23 @@ describe( "{{{\n x: Input1.text \n}}}window*", ); }); + + it("2. should logout user successfully using global logoutUser function and should redirect to the same app on login", () => { + agHelper.RefreshPage(); + EditorNavigation.SelectEntityByName("Page1", EntityType.Page); + EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); + propPane.EnterJSContext( + "onClick", + "{{logoutUser(appsmith.URL.pathname)}}", + true, + false, + ); + propPane.ToggleJSMode("onClick", false); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "LOGOUT GLOBAL"); + agHelper.ClickButton("LOGOUT GLOBAL"); + cy.LoginUser(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false); + agHelper.AssertElementVisibility(locators._buttonByText("")); + }); }, ); diff --git a/app/client/src/ce/constants/messages.ts b/app/client/src/ce/constants/messages.ts index a39290d43c74..a90a49de5ea8 100644 --- a/app/client/src/ce/constants/messages.ts +++ b/app/client/src/ce/constants/messages.ts @@ -629,6 +629,7 @@ export const GET_GEO_LOCATION = () => `Get geolocation`; export const WATCH_GEO_LOCATION = () => `Watch geolocation`; export const STOP_WATCH_GEO_LOCATION = () => `Stop watching geolocation`; export const POST_MESSAGE = () => `Post message`; +export const LOGOUT_USER = () => `Logout user`; //js actions export const JS_ACTION_COPY_SUCCESS = (actionName: string, pageName: string) => diff --git a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts index f3e34f2c4422..f7f7c27f8ba2 100644 --- a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts +++ b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts @@ -121,6 +121,22 @@ describe("Test Field Group Config", () => { expectedLabel: "Stop watching geolocation", expectedFields: [], }, + { + index: 15, + input: AppsmithFunction.postWindowMessage, + expectedLabel: "Post message", + expectedFields: [ + FieldType.MESSAGE_FIELD, + FieldType.SOURCE_FIELD, + FieldType.TARGET_ORIGIN_FIELD, + ], + }, + { + index: 15, + input: AppsmithFunction.logoutUser, + expectedLabel: "Logout user", + expectedFields: [FieldType.URL_FIELD], + }, ]; test.each( diff --git a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.ts b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.ts index 4344a0486266..be5a6ae53980 100644 --- a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.ts +++ b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.ts @@ -9,6 +9,7 @@ import { EXECUTE_A_QUERY, EXECUTE_JS_FUNCTION, GET_GEO_LOCATION, + LOGOUT_USER, NAVIGATE_TO, NO_ACTION, SHOW_MODAL, @@ -167,4 +168,10 @@ export const FIELD_GROUP_CONFIG: FieldGroupConfig = { defaultParams: `"", "window", "*"`, icon: "chat-upload-line", }, + [AppsmithFunction.logoutUser]: { + label: createMessage(LOGOUT_USER), + fields: [FieldType.URL_FIELD], + defaultParams: `""`, + icon: "logout", + }, }; diff --git a/app/client/src/components/editorComponents/ActionCreator/viewComponents/ActionBlockTree/utils.tsx b/app/client/src/components/editorComponents/ActionCreator/viewComponents/ActionBlockTree/utils.tsx index b148e4e40036..d082ade239df 100644 --- a/app/client/src/components/editorComponents/ActionCreator/viewComponents/ActionBlockTree/utils.tsx +++ b/app/client/src/components/editorComponents/ActionCreator/viewComponents/ActionBlockTree/utils.tsx @@ -89,6 +89,9 @@ function GetIconForAction( case AppsmithFunction.postWindowMessage: return () => ; + case AppsmithFunction.logoutUser: + return () => ; + default: return () => ; } @@ -205,6 +208,11 @@ function getActionHeading( return ( FIELD_CONFIG[FieldType.MESSAGE_FIELD].getter(code) || "Add message" ); + + case AppsmithFunction.logoutUser: + return ( + FIELD_CONFIG[FieldType.URL_FIELD].getter(code) || "Add redirect url" + ); } return ""; From f3a973364e63e8583e1fb164ac6268963986e504 Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Mon, 31 Mar 2025 23:35:28 +0530 Subject: [PATCH 5/7] fix: index --- .../ActionCreator/FieldGroup/FieldGroupConfig.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts index f7f7c27f8ba2..4cb5c60c0fd3 100644 --- a/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts +++ b/app/client/src/components/editorComponents/ActionCreator/FieldGroup/FieldGroupConfig.test.ts @@ -122,7 +122,7 @@ describe("Test Field Group Config", () => { expectedFields: [], }, { - index: 15, + index: 16, input: AppsmithFunction.postWindowMessage, expectedLabel: "Post message", expectedFields: [ @@ -132,7 +132,7 @@ describe("Test Field Group Config", () => { ], }, { - index: 15, + index: 17, input: AppsmithFunction.logoutUser, expectedLabel: "Logout user", expectedFields: [FieldType.URL_FIELD], From 6a844137000bf5138d7af6cb6eba344a229da1fc Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Tue, 1 Apr 2025 16:30:27 +0530 Subject: [PATCH 6/7] fix: logout user with redirect url to the current page, cypress loginfromapi with redirecturl --- .../ActionSelector_JsToNonJSMode_4_spec.ts | 33 +++++++++++-------- app/client/cypress/support/commands.js | 10 ++++-- app/client/cypress/support/index.d.ts | 2 +- app/client/src/ce/sagas/userSagas.tsx | 2 +- 4 files changed, 29 insertions(+), 18 deletions(-) diff --git a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts index 4460ab4349b7..32aff937035c 100644 --- a/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts +++ b/app/client/cypress/e2e/Regression/ClientSide/ActionExecution/ActionSelector_JsToNonJSMode_4_spec.ts @@ -55,21 +55,28 @@ describe( }); it("2. should logout user successfully using global logoutUser function and should redirect to the same app on login", () => { - agHelper.RefreshPage(); + let applicationUrl = ""; EditorNavigation.SelectEntityByName("Page1", EntityType.Page); EditorNavigation.SelectEntityByName("Button1", EntityType.Widget); - propPane.EnterJSContext( - "onClick", - "{{logoutUser(appsmith.URL.pathname)}}", - true, - false, - ); - propPane.ToggleJSMode("onClick", false); - propPane.UpdatePropertyFieldValue("Label", ""); - propPane.TypeTextIntoField("Label", "LOGOUT GLOBAL"); - agHelper.ClickButton("LOGOUT GLOBAL"); - cy.LoginUser(Cypress.env("USERNAME"), Cypress.env("PASSWORD"), false); - agHelper.AssertElementVisibility(locators._buttonByText("")); + propPane.EnterJSContext("onClick", "{{logoutUser()}}", true, false); + cy.location().then((loc) => { + applicationUrl = loc.pathname; + propPane.ToggleJSMode("onClick", false); + propPane.UpdatePropertyFieldValue("Label", ""); + propPane.TypeTextIntoField("Label", "LOGOUT GLOBAL"); + agHelper.ClickButton("LOGOUT GLOBAL"); + cy.location().should((loc) => { + expect(loc.pathname).to.eq("/user/login"); + }); + cy.LoginFromAPI( + Cypress.env("USERNAME"), + Cypress.env("PASSWORD"), + applicationUrl, + ); + agHelper.AssertElementVisibility( + locators._buttonByText("LOGOUT GLOBAL"), + ); + }); }); }, ); diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index f46a07f75664..2bc5fd1bf5b4 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -171,7 +171,7 @@ Cypress.Commands.add("LogintoApp", (uname, pword) => { initLocalstorage(); }); -Cypress.Commands.add("LoginFromAPI", (uname, pword) => { +Cypress.Commands.add("LoginFromAPI", (uname, pword, redirectUrl) => { homePageTS.LogOutviaAPI(); let baseURL = Cypress.config().baseUrl; baseURL = baseURL.endsWith("/") ? baseURL.slice(0, -1) : baseURL; @@ -181,7 +181,7 @@ Cypress.Commands.add("LoginFromAPI", (uname, pword) => { cy.visit({ method: "POST", - url: "api/v1/login", + url: `api/v1/login${redirectUrl ? "?redirectUrl=" + redirectUrl : ""}`, headers: { origin: baseURL, "X-Requested-By": "Appsmith", @@ -209,7 +209,11 @@ Cypress.Commands.add("LoginFromAPI", (uname, pword) => { } cy.location().should((loc) => { - expect(loc.href).to.eq(loc.origin + "/applications"); + if (redirectUrl) { + expect(loc.href).to.eq(loc.origin + redirectUrl); + } else { + expect(loc.href).to.eq(loc.origin + "/applications"); + } }); if (CURRENT_REPO === REPO.EE) { diff --git a/app/client/cypress/support/index.d.ts b/app/client/cypress/support/index.d.ts index 334899818c80..19483325dd0e 100644 --- a/app/client/cypress/support/index.d.ts +++ b/app/client/cypress/support/index.d.ts @@ -53,7 +53,7 @@ declare namespace Cypress { Signup(uname: string, pword: string); - LoginFromAPI(uname: string, pword: string); + LoginFromAPI(uname: string, pword: string, redirectUrl?: string); DeletepageFromSideBar(); diff --git a/app/client/src/ce/sagas/userSagas.tsx b/app/client/src/ce/sagas/userSagas.tsx index 24aceff6e035..acbabc0185d4 100644 --- a/app/client/src/ce/sagas/userSagas.tsx +++ b/app/client/src/ce/sagas/userSagas.tsx @@ -728,7 +728,7 @@ export const setMessageConfig = (id: string, config: ProductAlertConfig) => { export function* globalFunctionLogoutUser( action: ReduxAction<{ redirectURL: string }>, ) { - const redirectURL = `${AUTH_LOGIN_URL}${action.payload?.redirectURL ? "?redirectUrl=" + action.payload?.redirectURL : ""}`; + const redirectURL = `${AUTH_LOGIN_URL}?redirectUrl=${action.payload?.redirectURL ? action.payload?.redirectURL : history.location.pathname}`; yield call(logoutSaga, { type: ReduxActionTypes.LOGOUT_USER_INIT, From 3f0ebad63866767efbba4522f1eb680d42329c2b Mon Sep 17 00:00:00 2001 From: Aman Agarwal Date: Tue, 1 Apr 2025 17:56:43 +0530 Subject: [PATCH 7/7] fix: cypress loginfromapi with redirecturl --- app/client/cypress/support/commands.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index 2bc5fd1bf5b4..4939aa0d323e 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -219,7 +219,9 @@ Cypress.Commands.add("LoginFromAPI", (uname, pword, redirectUrl) => { if (CURRENT_REPO === REPO.EE) { cy.wait(2000); } else { - assertHelper.AssertNetworkStatus("getAllWorkspaces"); + if (!redirectUrl) { + assertHelper.AssertNetworkStatus("getAllWorkspaces"); + } assertHelper.AssertNetworkStatus("getConsolidatedData"); } });