@@ -21,7 +21,6 @@ const TaskResetPasswordInternal = () => {
2121 const card = useCardState ( ) ;
2222 const {
2323 userSettings : { passwordSettings } ,
24- authConfig : { reverification } ,
2524 } = useEnvironment ( ) ;
2625
2726 const { t, locale } = useLocalizations ( ) ;
@@ -31,8 +30,6 @@ const TaskResetPasswordInternal = () => {
3130 ( user : UserResource , opts : Parameters < UserResource [ 'updatePassword' ] > ) => user . updatePassword ( ...opts ) ,
3231 ) ;
3332
34- const currentPasswordRequired = user && user . passwordEnabled && ! reverification ;
35-
3633 const handleSignOut = ( ) => {
3734 if ( otherSessions . length === 0 ) {
3835 return signOut ( navigateAfterSignOut ) ;
@@ -41,13 +38,6 @@ const TaskResetPasswordInternal = () => {
4138 return signOut ( navigateAfterMultiSessionSingleSignOutUrl , { sessionId : session ?. id } ) ;
4239 } ;
4340
44- // TODO: remove this field
45- const currentPasswordField = useFormControl ( 'currentPassword' , '' , {
46- type : 'password' ,
47- label : localizationKeys ( 'formFieldLabel__currentPassword' ) ,
48- isRequired : true ,
49- } ) ;
50-
5141 const passwordField = useFormControl ( 'newPassword' , '' , {
5242 type : 'password' ,
5343 label : localizationKeys ( 'formFieldLabel__newPassword' ) ,
@@ -90,13 +80,12 @@ const TaskResetPasswordInternal = () => {
9080 try {
9181 await updatePasswordWithReverification ( user , [
9282 {
93- currentPassword : currentPasswordRequired ? currentPasswordField . value : undefined ,
9483 newPassword : passwordField . value ,
9584 signOutOfOtherSessions : sessionsField . checked ,
9685 } ,
9786 ] ) ;
9887 } catch ( e ) {
99- return handleError ( e , [ currentPasswordField , passwordField , confirmField ] , card . setError ) ;
88+ return handleError ( e , [ passwordField , confirmField ] , card . setError ) ;
10089 }
10190 } ;
10291
@@ -132,16 +121,6 @@ const TaskResetPasswordInternal = () => {
132121 value = { session ?. publicUserData . identifier || '' }
133122 style = { { display : 'none' } }
134123 />
135- { currentPasswordRequired && (
136- < Form . ControlRow elementId = { currentPasswordField . id } >
137- < Form . PasswordInput
138- { ...currentPasswordField . props }
139- minLength = { 6 }
140- isRequired
141- autoFocus
142- />
143- </ Form . ControlRow >
144- ) }
145124 < Form . ControlRow elementId = { passwordField . id } >
146125 < Form . PasswordInput
147126 { ...passwordField . props }
0 commit comments