@@ -7,15 +7,14 @@ import { NativeStackNavigationProp } from '@react-navigation/native-stack';
77import { useDispatch } from 'react-redux' ;
88import { sha256 } from 'js-sha256' ;
99
10- import { IProfileParams } from '../../definitions/IProfile' ;
1110import { twoFactor } from '../../lib/services/twoFactor' ;
1211import { ProfileStackParamList } from '../../stacks/types' ;
1312import { ControlledFormTextInput } from '../../containers/TextInput' ;
1413import { useAppSelector } from '../../lib/hooks/useAppSelector' ;
1514import { isAndroid , showErrorAlert } from '../../lib/methods/helpers' ;
1615import { useTheme } from '../../theme' ;
1716import { TwoFactorMethods } from '../../definitions/ITotp' ;
18- import { saveUserProfile } from '../../lib/services/restApi' ;
17+ import { saveUserProfile , setPassword } from '../../lib/services/restApi' ;
1918import { events , logEvent } from '../../lib/methods/helpers/log' ;
2019import { setUser } from '../../actions/login' ;
2120import { LISTENER } from '../../containers/Toast' ;
@@ -105,11 +104,11 @@ const ChangePasswordView = ({ navigation }: IChangePasswordViewProps) => {
105104 } ;
106105
107106 const changePassword = async ( ) => {
108- const { newPassword, currentPassword } = inputValues ;
107+ const { newPassword } = inputValues ;
109108
110109 try {
111110 setValue ( 'saving' , true ) ;
112- await saveUserProfile ( { newPassword, currentPassword : sha256 ( currentPassword ) } as IProfileParams ) ;
111+ await setPassword ( newPassword ) ;
113112 dispatch ( setUser ( { requirePasswordChange : false } ) ) ;
114113 navigation . goBack ( ) ;
115114 } catch ( error : any ) {
0 commit comments