Fix email signup when LDAP is present
Этот коммит содержится в:
@@ -25,6 +25,7 @@ class SignupUserComplete extends React.Component {
|
|||||||
|
|
||||||
this.handleSubmit = this.handleSubmit.bind(this);
|
this.handleSubmit = this.handleSubmit.bind(this);
|
||||||
this.inviteInfoRecieved = this.inviteInfoRecieved.bind(this);
|
this.inviteInfoRecieved = this.inviteInfoRecieved.bind(this);
|
||||||
|
this.handleLdapSignup = this.handleLdapSignup.bind(this);
|
||||||
|
|
||||||
this.state = {
|
this.state = {
|
||||||
data: '',
|
data: '',
|
||||||
@@ -81,6 +82,23 @@ class SignupUserComplete extends React.Component {
|
|||||||
teamId: data.id
|
teamId: data.id
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleLdapSignup(method, loginId, password, token) {
|
||||||
|
Client.loginByLdap(this.state.teamName, loginId, password, token,
|
||||||
|
() => {
|
||||||
|
const redirect = Utils.getUrlParameter('redirect');
|
||||||
|
if (redirect) {
|
||||||
|
browserHistory.push(decodeURIComponent(redirect));
|
||||||
|
} else {
|
||||||
|
browserHistory.push('/' + this.state.teamName + '/channels/town-square');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
this.setState({serverError: err.message});
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
handleSubmit(e) {
|
handleSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
@@ -368,7 +386,7 @@ class SignupUserComplete extends React.Component {
|
|||||||
defaultMessage='With your LDAP credentials'
|
defaultMessage='With your LDAP credentials'
|
||||||
/>
|
/>
|
||||||
</strong></h5>
|
</strong></h5>
|
||||||
<LoginLdap teamName={this.state.teamName}/>
|
<LoginLdap submit={this.handleLdapSignup}/>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -376,7 +394,7 @@ class SignupUserComplete extends React.Component {
|
|||||||
let emailSignup;
|
let emailSignup;
|
||||||
if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
|
if (global.window.mm_config.EnableSignUpWithEmail === 'true') {
|
||||||
emailSignup = (
|
emailSignup = (
|
||||||
<div>
|
<form>
|
||||||
<div className='inner__content'>
|
<div className='inner__content'>
|
||||||
{email}
|
{email}
|
||||||
{yourEmailIs}
|
{yourEmailIs}
|
||||||
@@ -432,7 +450,7 @@ class SignupUserComplete extends React.Component {
|
|||||||
</button>
|
</button>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -485,40 +503,36 @@ class SignupUserComplete extends React.Component {
|
|||||||
</div>
|
</div>
|
||||||
<div className='col-sm-12'>
|
<div className='col-sm-12'>
|
||||||
<div className='signup-team__container padding--less'>
|
<div className='signup-team__container padding--less'>
|
||||||
<div>
|
<img
|
||||||
<form>
|
className='signup-team-logo'
|
||||||
<img
|
src={logoImage}
|
||||||
className='signup-team-logo'
|
/>
|
||||||
src={logoImage}
|
<h5 className='margin--less'>
|
||||||
/>
|
<FormattedMessage
|
||||||
<h5 className='margin--less'>
|
id='signup_user_completed.welcome'
|
||||||
<FormattedMessage
|
defaultMessage='Welcome to:'
|
||||||
id='signup_user_completed.welcome'
|
/>
|
||||||
defaultMessage='Welcome to:'
|
</h5>
|
||||||
/>
|
<h2 className='signup-team__name'>{this.state.teamName}</h2>
|
||||||
</h5>
|
<h2 className='signup-team__subdomain'>
|
||||||
<h2 className='signup-team__name'>{this.state.teamName}</h2>
|
<FormattedMessage
|
||||||
<h2 className='signup-team__subdomain'>
|
id='signup_user_completed.onSite'
|
||||||
<FormattedMessage
|
defaultMessage='on {siteName}'
|
||||||
id='signup_user_completed.onSite'
|
values={{
|
||||||
defaultMessage='on {siteName}'
|
siteName: global.window.mm_config.SiteName
|
||||||
values={{
|
}}
|
||||||
siteName: global.window.mm_config.SiteName
|
/>
|
||||||
}}
|
</h2>
|
||||||
/>
|
<h4 className='color--light'>
|
||||||
</h2>
|
<FormattedMessage
|
||||||
<h4 className='color--light'>
|
id='signup_user_completed.lets'
|
||||||
<FormattedMessage
|
defaultMessage="Let's create your account"
|
||||||
id='signup_user_completed.lets'
|
/>
|
||||||
defaultMessage="Let's create your account"
|
</h4>
|
||||||
/>
|
{signupMessage}
|
||||||
</h4>
|
{ldapSignup}
|
||||||
{signupMessage}
|
{emailSignup}
|
||||||
{ldapSignup}
|
{serverError}
|
||||||
{emailSignup}
|
|
||||||
{serverError}
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user