Skip to content

Commit 5e94d93

Browse files
committed
feat(LoginPage): added isPasswordRequired prop
1 parent 54e11ce commit 5e94d93

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/react-core/src/components/LoginPage/LoginForm.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ export interface LoginFormProps extends Omit<React.HTMLProps<HTMLFormElement>, '
2828
onChangeUsername?: (event: React.FormEvent<HTMLInputElement>, value: string) => void;
2929
/** Flag indicating if the username is valid */
3030
isValidUsername?: boolean;
31+
/** Flag indicating if password is required */
32+
isPasswordRequired?: boolean;
3133
/** Label for the password input field */
3234
passwordLabel?: string;
3335
/** Value for the password */
@@ -66,6 +68,7 @@ export const LoginForm: React.FunctionComponent<LoginFormProps> = ({
6668
usernameValue = '',
6769
onChangeUsername = () => undefined as any,
6870
isValidUsername = true,
71+
isPasswordRequired = true,
6972
passwordLabel = 'Password',
7073
passwordValue = '',
7174
onChangePassword = () => undefined as any,
@@ -118,7 +121,7 @@ export const LoginForm: React.FunctionComponent<LoginFormProps> = ({
118121
onChange={onChangeUsername}
119122
/>
120123
</FormGroup>
121-
<FormGroup label={passwordLabel} isRequired fieldId="pf-login-password-id">
124+
<FormGroup label={passwordLabel} isRequired={isPasswordRequired} fieldId="pf-login-password-id">
122125
{isShowPasswordEnabled && (
123126
<InputGroup>
124127
<InputGroupItem isFill>{passwordInput}</InputGroupItem>

0 commit comments

Comments
 (0)