import React from 'react'; import PropTypes from 'prop-types'; import loggerFactory from '@alias/logger'; import { withTranslation } from 'react-i18next'; import LoginContainer from '../services/LoginContainer'; import { createSubscribedElement } from './UnstatedUtils'; const logger = loggerFactory('growi:loginForm'); class LoginForm extends React.Component { constructor(props) { super(props); this.isRegistrationEnabled = false; this.registrationMode = 'Closed'; this.registrationWhiteList = []; this.isLocalStrategySetup = false; this.isLdapStrategySetup = false; this.objOfIsExternalAuthEnableds = {}; this.switchForm = this.switchForm.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); } async componentDidMount() { const { loginContainer } = this.props; try { await loginContainer.retrieveData(); } catch (err) { loginContainer.setState({ retrieveError: err.message }); logger.error(err); } } // for flip [TODO][GW-1865] use state or react component for flip switchForm(e) { if (e.target.id === 'register') { $('#login-dialog').addClass('to-flip'); } else { $('#login-dialog').removeClass('to-flip'); } } 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')}