File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
AsideNavigation/YdbInternalUser
store/reducers/capabilities Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,9 @@ import routes from '../../routes';
1414import type { RootState } from '../../store' ;
1515import { authenticationApi } from '../../store/reducers/authentication/authentication' ;
1616import {
17- useAccessTotallyRestricted ,
1817 useCapabilitiesLoaded ,
1918 useCapabilitiesQuery ,
19+ useClusterWithoutAuthInUI ,
2020} from '../../store/reducers/capabilities/hooks' ;
2121import { nodesListApi } from '../../store/reducers/nodesList' ;
2222import { cn } from '../../utils/cn' ;
@@ -228,18 +228,18 @@ interface ContentWrapperProps {
228228
229229function ContentWrapper ( props : ContentWrapperProps ) {
230230 const { singleClusterMode, isAuthenticated} = props ;
231- const isForbidded = useAccessTotallyRestricted ( ) ;
231+ const authUnavailable = useClusterWithoutAuthInUI ( ) ;
232232
233233 const renderNotAuthenticated = ( ) => {
234- if ( isForbidded ) {
234+ if ( authUnavailable ) {
235235 return < AccessDenied /> ;
236236 }
237237 return < Authentication /> ;
238238 } ;
239239
240240 return (
241241 < Switch >
242- { ! isForbidded && (
242+ { ! authUnavailable && (
243243 < Route path = { routes . auth } >
244244 < Authentication closable />
245245 </ Route >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import {useHistory} from 'react-router-dom';
44
55import routes , { createHref } from '../../../routes' ;
66import { authenticationApi } from '../../../store/reducers/authentication/authentication' ;
7- import { useAccessTotallyRestricted } from '../../../store/reducers/capabilities/hooks' ;
7+ import { useClusterWithoutAuthInUI } from '../../../store/reducers/capabilities/hooks' ;
88import { cn } from '../../../utils/cn' ;
99import { useDatabaseFromQuery } from '../../../utils/hooks/useDatabaseFromQuery' ;
1010import i18n from '../i18n' ;
@@ -15,7 +15,7 @@ const b = cn('kv-ydb-internal-user');
1515
1616export function YdbInternalUser ( { login} : { login ?: string } ) {
1717 const [ logout ] = authenticationApi . useLogoutMutation ( ) ;
18- const isForbidded = useAccessTotallyRestricted ( ) ;
18+ const authUnavailable = useClusterWithoutAuthInUI ( ) ;
1919 const database = useDatabaseFromQuery ( ) ;
2020
2121 const history = useHistory ( ) ;
@@ -33,7 +33,7 @@ export function YdbInternalUser({login}: {login?: string}) {
3333 } ;
3434
3535 const renderLoginButton = ( ) => {
36- if ( isForbidded ) {
36+ if ( authUnavailable ) {
3737 return null ;
3838 }
3939 return (
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ const useGetSecuritySetting = (feature: SecuritySetting) => {
8080 return useTypedSelector ( ( state ) => selectSecuritySetting ( state , feature , database ) ) ;
8181} ;
8282
83- export const useAccessTotallyRestricted = ( ) => {
83+ export const useClusterWithoutAuthInUI = ( ) => {
8484 return useGetSecuritySetting ( 'UseLoginProvider' ) === false ;
8585} ;
8686
You can’t perform that action at this time.
0 commit comments