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.
This commit is contained in:
parent
605fa96a34
commit
73fff8b817
2 changed files with 9 additions and 4 deletions
|
|
@ -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) => {
|
|||
<Tooltip
|
||||
title={
|
||||
<div className="text-center">
|
||||
{authDetails.edition === 'ee' ? (
|
||||
{isEnterprise ? (
|
||||
<span>
|
||||
{t('SSO has not been configured.')}
|
||||
<br />
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
},
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue