Skip to content

Commit 1eb44e1

Browse files
authored
Allow passwords to be visible on security screens (#77394)
1 parent e7d8ea3 commit 1eb44e1

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

x-pack/plugins/security/public/account_management/account_management_page.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ describe('<AccountManagementPage>', () => {
115115
wrapper.update();
116116
});
117117

118-
expect(wrapper.find('EuiFieldText[data-test-subj="currentPassword"]')).toHaveLength(1);
119-
expect(wrapper.find('EuiFieldText[data-test-subj="newPassword"]')).toHaveLength(1);
118+
expect(wrapper.find('EuiFieldPassword[data-test-subj="currentPassword"]')).toHaveLength(1);
119+
expect(wrapper.find('EuiFieldPassword[data-test-subj="newPassword"]')).toHaveLength(1);
120120
});
121121

122122
it(`does not display change password form for users in the saml realm`, async () => {

x-pack/plugins/security/public/authentication/login/components/login_form/__snapshots__/login_form.test.tsx.snap

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

x-pack/plugins/security/public/authentication/login/components/login_form/login_form.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ export class LoginForm extends Component<Props, State> {
221221
id="password"
222222
name="password"
223223
data-test-subj="loginPassword"
224+
type={'dual'}
224225
value={this.state.password}
225226
onChange={this.onPasswordChange}
226227
disabled={!this.isLoadingState(LoadingStateType.None)}

x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* or more contributor license agreements. Licensed under the Elastic License;
44
* you may not use this file except in compliance with the Elastic License.
55
*/
6-
import { EuiFieldText } from '@elastic/eui';
6+
import { EuiFieldPassword } from '@elastic/eui';
77
import { ReactWrapper } from 'enzyme';
88
import React from 'react';
99
import { mountWithIntl } from 'test_utils/enzyme_helpers';
@@ -14,15 +14,15 @@ import { coreMock } from '../../../../../../../../src/core/public/mocks';
1414
import { userAPIClientMock } from '../../index.mock';
1515

1616
function getCurrentPasswordField(wrapper: ReactWrapper<any>) {
17-
return wrapper.find(EuiFieldText).filter('[data-test-subj="currentPassword"]');
17+
return wrapper.find(EuiFieldPassword).filter('[data-test-subj="currentPassword"]');
1818
}
1919

2020
function getNewPasswordField(wrapper: ReactWrapper<any>) {
21-
return wrapper.find(EuiFieldText).filter('[data-test-subj="newPassword"]');
21+
return wrapper.find(EuiFieldPassword).filter('[data-test-subj="newPassword"]');
2222
}
2323

2424
function getConfirmPasswordField(wrapper: ReactWrapper<any>) {
25-
return wrapper.find(EuiFieldText).filter('[data-test-subj="confirmNewPassword"]');
25+
return wrapper.find(EuiFieldPassword).filter('[data-test-subj="confirmNewPassword"]');
2626
}
2727

2828
describe('<ChangePasswordForm>', () => {

x-pack/plugins/security/public/management/users/components/change_password_form/change_password_form.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import {
77
EuiButton,
88
EuiButtonEmpty,
9-
EuiFieldText,
9+
EuiFieldPassword,
1010
EuiFlexGroup,
1111
EuiFlexItem,
1212
EuiForm,
@@ -72,10 +72,10 @@ export class ChangePasswordForm extends Component<Props, State> {
7272
/>
7373
}
7474
>
75-
<EuiFieldText
75+
<EuiFieldPassword
7676
autoComplete="off"
7777
data-test-subj="currentPassword"
78-
type="password"
78+
type="dual"
7979
value={this.state.currentPassword}
8080
onChange={this.onCurrentPasswordChange}
8181
disabled={this.state.changeInProgress}
@@ -100,10 +100,10 @@ export class ChangePasswordForm extends Component<Props, State> {
100100
/>
101101
}
102102
>
103-
<EuiFieldText
103+
<EuiFieldPassword
104104
autoComplete="new-password"
105105
data-test-subj="newPassword"
106-
type="password"
106+
type="dual"
107107
value={this.state.newPassword}
108108
onChange={this.onNewPasswordChange}
109109
disabled={this.state.changeInProgress}
@@ -120,10 +120,10 @@ export class ChangePasswordForm extends Component<Props, State> {
120120
/>
121121
}
122122
>
123-
<EuiFieldText
123+
<EuiFieldPassword
124124
autoComplete="new-password"
125125
data-test-subj="confirmNewPassword"
126-
type="password"
126+
type="dual"
127127
value={this.state.confirmPassword}
128128
onChange={this.onConfirmPasswordChange}
129129
disabled={this.state.changeInProgress}

0 commit comments

Comments
 (0)