mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
fix: hide change password when simple auth is disabled (#3282)
https://linear.app/unleash/issue/2-764/change-password-should-be-disabled-when-password-login-is-disabled Hides "Change password" option on the profile page when "Password based login" is disabled. ![image](https://user-images.githubusercontent.com/14320932/224018081-d866a17f-97a4-4e6e-8057-2f60a20e3d52.png)
This commit is contained in:
parent
7c85cab6b2
commit
d96a2134f3
@ -1,6 +1,7 @@
|
|||||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
||||||
import { ITab, VerticalTabs } from 'component/common/VerticalTabs/VerticalTabs';
|
import { ITab, VerticalTabs } from 'component/common/VerticalTabs/VerticalTabs';
|
||||||
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
|
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
|
||||||
|
import useAuthSettings from 'hooks/api/getters/useAuthSettings/useAuthSettings';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useLocation, useNavigate } from 'react-router-dom';
|
import { useLocation, useNavigate } from 'react-router-dom';
|
||||||
import { PasswordTab } from './PasswordTab/PasswordTab';
|
import { PasswordTab } from './PasswordTab/PasswordTab';
|
||||||
@ -11,10 +12,16 @@ export const Profile = () => {
|
|||||||
const { user } = useAuthUser();
|
const { user } = useAuthUser();
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
const { config: simpleAuthConfig } = useAuthSettings('simple');
|
||||||
|
|
||||||
const tabs = [
|
const tabs = [
|
||||||
{ id: 'profile', label: 'Profile' },
|
{ id: 'profile', label: 'Profile' },
|
||||||
{ id: 'password', label: 'Change password', path: 'change-password' },
|
{
|
||||||
|
id: 'password',
|
||||||
|
label: 'Change password',
|
||||||
|
path: 'change-password',
|
||||||
|
hidden: simpleAuthConfig.disabled,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
id: 'pat',
|
id: 'pat',
|
||||||
label: 'Personal API tokens',
|
label: 'Personal API tokens',
|
||||||
|
Loading…
Reference in New Issue
Block a user