diff --git a/frontend/src/_helpers/routes.js b/frontend/src/_helpers/routes.js index 9e60d522fa..0f552cb955 100644 --- a/frontend/src/_helpers/routes.js +++ b/frontend/src/_helpers/routes.js @@ -192,8 +192,21 @@ export const returnWorkspaceIdIfNeed = (path) => { }; export const getRedirectURL = (path) => { let redirectLoc = '/'; + const instanceLevelRoutes = [ + '/all-users', + '/all-workspaces', + '/manage-instance-settings', + '/white-labelling', + '/instance-login', + '/smtp', + '/license', + ]; if (path) { - redirectLoc = `${returnWorkspaceIdIfNeed(path)}${path !== '/' ? path : ''}`; + if (instanceLevelRoutes.includes(path)) { + redirectLoc = `/settings${path}`; + } else { + redirectLoc = `${returnWorkspaceIdIfNeed(path)}${path !== '/' ? path : ''}`; + } } else { const redirectTo = getRedirectTo(); const { from } = redirectTo ? { from: { pathname: redirectTo } } : { from: { pathname: '/' } }; diff --git a/server/src/modules/licensing/services/organization.service.ts b/server/src/modules/licensing/services/organization.service.ts index afcdb16383..980db68fec 100644 --- a/server/src/modules/licensing/services/organization.service.ts +++ b/server/src/modules/licensing/services/organization.service.ts @@ -27,8 +27,10 @@ export class LicenseOrganizationService implements ILicenseOrganizationService { } async limit(manager?: EntityManager): Promise { - const licenseTerms = await this.licenseTermsService.getLicenseTerms(LICENSE_FIELD.WORKSPACES); - + const licenseTerms = await this.licenseTermsService.getLicenseTerms([ + LICENSE_FIELD.WORKSPACES, + LICENSE_FIELD.STATUS, + ]); return await dbTransactionWrap(async (manager: EntityManager) => { return { workspacesCount: generatePayloadForLimits(