|
@@ -4,11 +4,8 @@ import { useTranslation } from 'next-i18next';
|
|
|
import PropTypes from 'prop-types';
|
|
import PropTypes from 'prop-types';
|
|
|
import ReactCardFlip from 'react-card-flip';
|
|
import ReactCardFlip from 'react-card-flip';
|
|
|
|
|
|
|
|
-import AppContainer from '~/client/services/AppContainer';
|
|
|
|
|
import { useCsrfToken } from '~/stores/context';
|
|
import { useCsrfToken } from '~/stores/context';
|
|
|
|
|
|
|
|
-import { withUnstatedContainers } from './UnstatedUtils';
|
|
|
|
|
-
|
|
|
|
|
class LoginForm extends React.Component {
|
|
class LoginForm extends React.Component {
|
|
|
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
@@ -148,7 +145,7 @@ class LoginForm extends React.Component {
|
|
|
renderRegisterForm() {
|
|
renderRegisterForm() {
|
|
|
const {
|
|
const {
|
|
|
t,
|
|
t,
|
|
|
- appContainer,
|
|
|
|
|
|
|
+ // appContainer,
|
|
|
csrfToken,
|
|
csrfToken,
|
|
|
isEmailAuthenticationEnabled,
|
|
isEmailAuthenticationEnabled,
|
|
|
username,
|
|
username,
|
|
@@ -156,9 +153,9 @@ class LoginForm extends React.Component {
|
|
|
email,
|
|
email,
|
|
|
registrationMode,
|
|
registrationMode,
|
|
|
registrationWhiteList,
|
|
registrationWhiteList,
|
|
|
|
|
+ isMailerSetup,
|
|
|
} = this.props;
|
|
} = this.props;
|
|
|
|
|
|
|
|
- const { isMailerSetup } = appContainer.config;
|
|
|
|
|
let registerAction = '/register';
|
|
let registerAction = '/register';
|
|
|
|
|
|
|
|
let submitText = t('Sign up');
|
|
let submitText = t('Sign up');
|
|
@@ -288,8 +285,10 @@ class LoginForm extends React.Component {
|
|
|
objOfIsExternalAuthEnableds,
|
|
objOfIsExternalAuthEnableds,
|
|
|
} = this.props;
|
|
} = this.props;
|
|
|
|
|
|
|
|
|
|
+
|
|
|
const isLocalOrLdapStrategiesEnabled = isLocalStrategySetup || isLdapStrategySetup;
|
|
const isLocalOrLdapStrategiesEnabled = isLocalStrategySetup || isLdapStrategySetup;
|
|
|
- const isSomeExternalAuthEnabled = Object.values(objOfIsExternalAuthEnableds).some(elem => elem);
|
|
|
|
|
|
|
+ // const isSomeExternalAuthEnabled = Object.values(objOfIsExternalAuthEnableds).some(elem => elem);
|
|
|
|
|
+ const isSomeExternalAuthEnabled = true;
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<div className="login-dialog mx-auto" id="login-dialog">
|
|
<div className="login-dialog mx-auto" id="login-dialog">
|
|
@@ -332,7 +331,7 @@ class LoginForm extends React.Component {
|
|
|
LoginForm.propTypes = {
|
|
LoginForm.propTypes = {
|
|
|
// i18next
|
|
// i18next
|
|
|
t: PropTypes.func.isRequired,
|
|
t: PropTypes.func.isRequired,
|
|
|
- appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
|
|
|
|
|
+ // appContainer: PropTypes.instanceOf(AppContainer).isRequired,
|
|
|
|
|
|
|
|
csrfToken: PropTypes.string,
|
|
csrfToken: PropTypes.string,
|
|
|
isRegistering: PropTypes.bool,
|
|
isRegistering: PropTypes.bool,
|
|
@@ -347,6 +346,7 @@ LoginForm.propTypes = {
|
|
|
isLocalStrategySetup: PropTypes.bool,
|
|
isLocalStrategySetup: PropTypes.bool,
|
|
|
isLdapStrategySetup: PropTypes.bool,
|
|
isLdapStrategySetup: PropTypes.bool,
|
|
|
objOfIsExternalAuthEnableds: PropTypes.object,
|
|
objOfIsExternalAuthEnableds: PropTypes.object,
|
|
|
|
|
+ isMailerSetup: PropTypes.bool,
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
const LoginFormWrapperFC = (props) => {
|
|
const LoginFormWrapperFC = (props) => {
|
|
@@ -359,6 +359,7 @@ const LoginFormWrapperFC = (props) => {
|
|
|
/**
|
|
/**
|
|
|
* Wrapper component for using unstated
|
|
* Wrapper component for using unstated
|
|
|
*/
|
|
*/
|
|
|
-const LoginFormWrapper = withUnstatedContainers(LoginFormWrapperFC, [AppContainer]);
|
|
|
|
|
|
|
+// const LoginFormWrapper = withUnstatedContainers(LoginFormWrapperFC, [AppContainer]);
|
|
|
|
|
|
|
|
-export default LoginFormWrapper;
|
|
|
|
|
|
|
+// export default LoginForm;
|
|
|
|
|
+export default LoginFormWrapperFC;
|