Skip to content

Commit

Permalink
Add Captcha to HRDPane
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehobbsdev committed Feb 1, 2022
1 parent 0efd72d commit adf1008
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/connection/enterprise/hrd_pane.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@ import PropTypes from 'prop-types';
import React from 'react';
import UsernamePane from '../../field/username/username_pane';
import PasswordPane from '../../field/password/password_pane';
import CaptchaPane from '../../field/captcha/captcha_pane';
import { swapCaptcha } from '../captcha';
import * as l from '../../core/index';

export default class HRDPane extends React.Component {
render() {
const { header, i18n, model, passwordInputPlaceholder, usernameInputPlaceholder } = this.props;

const captchaPane =
l.captcha(model) && l.captcha(model).get('required') ? (
<CaptchaPane i18n={i18n} lock={model} onReload={() => swapCaptcha(l.id(model), false)} />
) : null;

return (
<div>
{header}
Expand All @@ -19,6 +26,7 @@ export default class HRDPane extends React.Component {
strictValidation={false}
/>
<PasswordPane i18n={i18n} lock={model} placeholder={passwordInputPlaceholder} />
{captchaPane}
</div>
);
}
Expand Down

0 comments on commit adf1008

Please sign in to comment.