From 0904dcd7f59a6bfb1da9f73203f74576bfc7c221 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Wed, 19 Mar 2025 14:35:11 +0100 Subject: [PATCH] feat(auth): support msaas edition for enterprise features Add msaas to the isEnterprise check alongside ee edition to properly display enterprise features. Use userStore.isEnterprise in SSOLogin component instead of directly checking authDetails.edition for consistent enterprise status detection. --- frontend/app/components/Login/SSOLogin.tsx | 5 ++++- frontend/app/mstore/userStore.ts | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/frontend/app/components/Login/SSOLogin.tsx b/frontend/app/components/Login/SSOLogin.tsx index 5b8e52216..6e604913c 100644 --- a/frontend/app/components/Login/SSOLogin.tsx +++ b/frontend/app/components/Login/SSOLogin.tsx @@ -4,6 +4,7 @@ import { Button, Tooltip } from 'antd'; import { useTranslation } from 'react-i18next'; import { ENTERPRISE_REQUEIRED } from 'App/constants'; import stl from './login.module.css'; +import { useStore } from 'App/mstore'; interface SSOLoginProps { authDetails: any; @@ -11,7 +12,9 @@ interface SSOLoginProps { } const SSOLogin = ({ authDetails, enforceSSO = false }: SSOLoginProps) => { + const { userStore } = useStore(); const { t } = useTranslation(); + const { isEnterprise } = userStore; const getSSOLink = () => window !== window.top @@ -44,7 +47,7 @@ const SSOLogin = ({ authDetails, enforceSSO = false }: SSOLoginProps) => { - {authDetails.edition === 'ee' ? ( + {isEnterprise ? ( {t('SSO has not been configured.')}
diff --git a/frontend/app/mstore/userStore.ts b/frontend/app/mstore/userStore.ts index 239c5881b..f29fcd325 100644 --- a/frontend/app/mstore/userStore.ts +++ b/frontend/app/mstore/userStore.ts @@ -114,7 +114,9 @@ class UserStore { get isEnterprise() { return ( this.account?.edition === 'ee' || - this.authStore.authDetails?.edition === 'ee' + this.account?.edition === 'msaas' || + this.authStore.authDetails?.edition === 'ee' || + this.authStore.authDetails?.edition === 'msaas' ); } @@ -663,14 +665,14 @@ class AuthStore { { key: 'authDetails', serialize: (ad) => { - delete ad.edition; + // delete ad.edition; return Object.keys(ad).length > 0 ? JSON.stringify(ad) : JSON.stringify({}); }, deserialize: (json) => { const ad = JSON.parse(json); - delete ad.edition; + // delete ad.edition; return ad; }, },