mirror of
				https://github.com/Unleash/unleash.git
				synced 2025-10-27 11:02:16 +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. 
This commit is contained in:
		
							parent
							
								
									7c85cab6b2
								
							
						
					
					
						commit
						d96a2134f3
					
				@ -1,6 +1,7 @@
 | 
			
		||||
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
 | 
			
		||||
import { ITab, VerticalTabs } from 'component/common/VerticalTabs/VerticalTabs';
 | 
			
		||||
import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser';
 | 
			
		||||
import useAuthSettings from 'hooks/api/getters/useAuthSettings/useAuthSettings';
 | 
			
		||||
import { useEffect, useState } from 'react';
 | 
			
		||||
import { useLocation, useNavigate } from 'react-router-dom';
 | 
			
		||||
import { PasswordTab } from './PasswordTab/PasswordTab';
 | 
			
		||||
@ -11,10 +12,16 @@ export const Profile = () => {
 | 
			
		||||
    const { user } = useAuthUser();
 | 
			
		||||
    const location = useLocation();
 | 
			
		||||
    const navigate = useNavigate();
 | 
			
		||||
    const { config: simpleAuthConfig } = useAuthSettings('simple');
 | 
			
		||||
 | 
			
		||||
    const tabs = [
 | 
			
		||||
        { 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',
 | 
			
		||||
            label: 'Personal API tokens',
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user