import React from 'react'; import PropTypes from 'prop-types'; import { withTranslation } from 'react-i18next'; class LoginForm extends React.Component { constructor(props) { super(props); this.state = { isRegistering: false, }; this.isRegistrationEnabled = false; this.registrationMode = 'Closed'; this.registrationWhiteList = []; this.isLocalStrategySetup = false; this.isLdapStrategySetup = false; this.objOfIsExternalAuthEnableds = {}; this.onClickSwitchFormBtn = this.onClickSwitchFormBtn.bind(this); this.renderLocalOrLdapLoginForm = this.renderLocalOrLdapLoginForm.bind(this); this.renderExternalAuthLoginForm = this.renderExternalAuthLoginForm.bind(this); this.renderExternalAuthInput = this.renderExternalAuthInput.bind(this); this.renderRegisterForm = this.renderRegisterForm.bind(this); } componentWillMount() { // [TODO][GW-1913] get params from server with axios this.isRegistrationEnabled = true; this.registrationMode = 'Open'; this.registrationWhiteList = []; this.isLocalStrategySetup = true; this.isLdapStrategySetup = true; this.objOfIsExternalAuthEnableds = { google: true, github: true, facebook: true, twitter: true, oidc: true, saml: true, basic: true, }; } componentDidMount() { const { hash } = window.location; if (hash === '#register') { this.setState({ isRegistering: true }); } } onClickSwitchFormBtn() { this.setState({ isRegistering: !this.state.isRegistering }); } renderLocalOrLdapLoginForm() { const { t, csrf } = this.props; return (
); } renderExternalAuthInput(auth) { const { t, csrf } = this.props; return (
{t('page_register.notice.restricted')}
{t('page_register.notice.restricted_defail')}