summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--api/oauth.go7
-rw-r--r--api/user.go2
-rw-r--r--model/team.go4
-rw-r--r--webapp/action_creators/websocket_actions.jsx18
-rw-r--r--webapp/components/claim/components/email_to_ldap.jsx14
-rw-r--r--webapp/components/login.jsx12
-rw-r--r--webapp/components/signup_team_complete/components/signup_team_complete.jsx4
-rw-r--r--webapp/components/signup_user_complete.jsx12
-rw-r--r--webapp/components/team_signup_with_sso.jsx2
-rw-r--r--webapp/components/user_settings/user_settings_security.jsx1
11 files changed, 48 insertions, 30 deletions
diff --git a/README.md b/README.md
index c329df925..2c7d9aaf3 100644
--- a/README.md
+++ b/README.md
@@ -47,5 +47,3 @@ Learn More:
- **Localization Guide** - Learn [how Mattermost supports different languages](http://docs.mattermost.com/developer/localization.html).
Any other questions, mail us at info@mattermost.com. We’d love to meet you!
-
-[![Build Status](https://travis-ci.org/mattermost/platform.svg?branch=master)](https://travis-ci.org/mattermost/platform)
diff --git a/api/oauth.go b/api/oauth.go
index 9b7f3699d..a7119d7e5 100644
--- a/api/oauth.go
+++ b/api/oauth.go
@@ -29,11 +29,14 @@ func InitOAuth(r *mux.Router) {
sr.Handle("/authorize", ApiUserRequired(authorizeOAuth)).Methods("GET")
sr.Handle("/access_token", ApiAppHandler(getAccessToken)).Methods("POST")
- // Also handle this a the old routes remove soon apiv2?
mr := Srv.Router
mr.Handle("/authorize", ApiUserRequired(authorizeOAuth)).Methods("GET")
mr.Handle("/access_token", ApiAppHandler(getAccessToken)).Methods("POST")
+
+ // Handle all the old routes, to be later removed
mr.Handle("/{service:[A-Za-z]+}/complete", AppHandlerIndependent(completeOAuth)).Methods("GET")
+ mr.Handle("/signup/{service:[A-Za-z]+}/complete", AppHandlerIndependent(completeOAuth)).Methods("GET")
+ mr.Handle("/login/{service:[A-Za-z]+}/complete", AppHandlerIndependent(completeOAuth)).Methods("GET")
}
func registerOAuthApp(c *Context, w http.ResponseWriter, r *http.Request) {
@@ -185,7 +188,7 @@ func completeOAuth(c *Context, w http.ResponseWriter, r *http.Request) {
code := r.URL.Query().Get("code")
state := r.URL.Query().Get("state")
- uri := c.GetSiteURL() + "/api/v1/oauth/" + service + "/complete"
+ uri := c.GetSiteURL() + "/signup/" + service + "/complete"
if body, team, props, err := AuthorizeOAuthUser(service, code, state, uri); err != nil {
c.Err = err
diff --git a/api/user.go b/api/user.go
index 6803a946c..43969158a 100644
--- a/api/user.go
+++ b/api/user.go
@@ -1938,7 +1938,7 @@ func GetAuthorizationCode(c *Context, service, teamName string, props map[string
props["team"] = teamName
state := b64.StdEncoding.EncodeToString([]byte(model.MapToJson(props)))
- redirectUri := c.GetSiteURL() + "/api/v1/oauth/" + service + "/complete"
+ redirectUri := c.GetSiteURL() + "/signup/" + service + "/complete"
authUrl := endpoint + "?response_type=code&client_id=" + clientId + "&redirect_uri=" + url.QueryEscape(redirectUri) + "&state=" + url.QueryEscape(state)
diff --git a/model/team.go b/model/team.go
index bed7bbd8d..d95dea110 100644
--- a/model/team.go
+++ b/model/team.go
@@ -237,5 +237,7 @@ func (o *Team) SanitizeForNotLoggedIn() {
o.Email = ""
o.AllowedDomains = ""
o.CompanyName = ""
- o.InviteId = ""
+ if !o.AllowOpenInvite {
+ o.InviteId = ""
+ }
}
diff --git a/webapp/action_creators/websocket_actions.jsx b/webapp/action_creators/websocket_actions.jsx
index 93b12692a..bb46db149 100644
--- a/webapp/action_creators/websocket_actions.jsx
+++ b/webapp/action_creators/websocket_actions.jsx
@@ -22,6 +22,7 @@ const WEBSOCKET_RETRY_TIME = 3000;
var conn = null;
var connectFailCount = 0;
var pastFirstInit = false;
+var manuallyClosed = false;
export function initialize() {
if (window.WebSocket && !conn) {
@@ -36,6 +37,8 @@ export function initialize() {
console.log('websocket connecting to ' + connUrl); //eslint-disable-line no-console
}
+ manuallyClosed = false;
+
conn = new WebSocket(connUrl);
conn.onopen = () => {
@@ -70,12 +73,14 @@ export function initialize() {
ErrorStore.setConnectionErrorCount(connectFailCount);
ErrorStore.emitChange();
- setTimeout(
- () => {
- initialize();
- },
- WEBSOCKET_RETRY_TIME
- );
+ if (!manuallyClosed) {
+ setTimeout(
+ () => {
+ initialize();
+ },
+ WEBSOCKET_RETRY_TIME
+ );
+ }
};
conn.onerror = (evt) => {
@@ -148,6 +153,7 @@ export function sendMessage(msg) {
}
export function close() {
+ manuallyClosed = true;
if (conn && conn.readyState === WebSocket.OPEN) {
conn.close();
}
diff --git a/webapp/components/claim/components/email_to_ldap.jsx b/webapp/components/claim/components/email_to_ldap.jsx
index 1f51f9cd5..1ceb42a27 100644
--- a/webapp/components/claim/components/email_to_ldap.jsx
+++ b/webapp/components/claim/components/email_to_ldap.jsx
@@ -21,7 +21,7 @@ export default class EmailToLDAP extends React.Component {
e.preventDefault();
var state = {};
- const password = ReactDOM.findDOMNode(this.refs.password).value.trim();
+ const password = ReactDOM.findDOMNode(this.refs.emailpassword).value.trim();
if (!password) {
state.error = Utils.localizeMessage('claim.email_to_ldap.pwdError', 'Please enter your password.');
this.setState(state);
@@ -105,12 +105,18 @@ export default class EmailToLDAP extends React.Component {
}}
/>
</p>
+ <input
+ type='text'
+ style={{display: 'none'}}
+ name='fakeusernameremembered'
+ />
<div className={formClass}>
<input
type='password'
className='form-control'
- name='password'
- ref='password'
+ name='emailPassword'
+ ref='emailpassword'
+ autoComplete='off'
placeholder={Utils.localizeMessage('claim.email_to_ldap.pwd', 'Password')}
spellCheck='false'
/>
@@ -131,6 +137,7 @@ export default class EmailToLDAP extends React.Component {
className='form-control'
name='ldapId'
ref='ldapid'
+ autoComplete='off'
placeholder={Utils.localizeMessage('claim.email_to_ldap.ldapId', 'LDAP ID')}
spellCheck='false'
/>
@@ -141,6 +148,7 @@ export default class EmailToLDAP extends React.Component {
className='form-control'
name='ldapPassword'
ref='ldappassword'
+ autoComplete='off'
placeholder={Utils.localizeMessage('claim.email_to_ldap.ldapPwd', 'LDAP Password')}
spellCheck='false'
/>
diff --git a/webapp/components/login.jsx b/webapp/components/login.jsx
index e8180895d..ff9cd74a8 100644
--- a/webapp/components/login.jsx
+++ b/webapp/components/login.jsx
@@ -60,10 +60,10 @@ export default class Login extends React.Component {
let loginMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
loginMessage.push(
- <Link
+ <a
className='btn btn-custom-login gitlab'
key='gitlab'
- to={'/api/v1/oauth/gitlab/login?team=' + encodeURIComponent(teamName)}
+ href={'/api/v1/oauth/gitlab/login?team=' + encodeURIComponent(teamName)}
>
<span className='icon'/>
<span>
@@ -72,16 +72,16 @@ export default class Login extends React.Component {
defaultMessage='with GitLab'
/>
</span>
- </Link>
+ </a>
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
loginMessage.push(
- <Link
+ <a
className='btn btn-custom-login google'
key='google'
- to={'/api/v1/oauth/google/login?team=' + encodeURIComponent(teamName)}
+ href={'/api/v1/oauth/google/login?team=' + encodeURIComponent(teamName)}
>
<span className='icon'/>
<span>
@@ -90,7 +90,7 @@ export default class Login extends React.Component {
defaultMessage='with Google Apps'
/>
</span>
- </Link>
+ </a>
);
}
diff --git a/webapp/components/signup_team_complete/components/signup_team_complete.jsx b/webapp/components/signup_team_complete/components/signup_team_complete.jsx
index 8b2096499..e5d310151 100644
--- a/webapp/components/signup_team_complete/components/signup_team_complete.jsx
+++ b/webapp/components/signup_team_complete/components/signup_team_complete.jsx
@@ -8,7 +8,7 @@ import {FormattedMessage} from 'react-intl';
import {browserHistory} from 'react-router';
import React from 'react';
-import Link from 'react-router';
+import {Link} from 'react-router';
export default class SignupTeamComplete extends React.Component {
constructor(props) {
@@ -55,7 +55,7 @@ export default class SignupTeamComplete extends React.Component {
<div>
<div className='signup-header'>
<Link to='/'>
- <span classNameName='fa fa-chevron-left'/>
+ <span className='fa fa-chevron-left'/>
<FormattedMessage id='web.header.back'/>
</Link>
</div>
diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx
index 5460daf29..78ab1bd8c 100644
--- a/webapp/components/signup_user_complete.jsx
+++ b/webapp/components/signup_user_complete.jsx
@@ -317,10 +317,10 @@ class SignupUserComplete extends React.Component {
var signupMessage = [];
if (global.window.mm_config.EnableSignUpWithGitLab === 'true') {
signupMessage.push(
- <Link
+ <a
className='btn btn-custom-login gitlab'
key='gitlab'
- to={'/api/v1/oauth/gitlab/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
+ href={'/api/v1/oauth/gitlab/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
>
<span className='icon'/>
<span>
@@ -329,16 +329,16 @@ class SignupUserComplete extends React.Component {
defaultMessage='with GitLab'
/>
</span>
- </Link>
+ </a>
);
}
if (global.window.mm_config.EnableSignUpWithGoogle === 'true') {
signupMessage.push(
- <Link
+ <a
className='btn btn-custom-login google'
key='google'
- to={'/api/v1/oauth/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
+ href={'/api/v1/oauth/google/signup' + window.location.search + '&team=' + encodeURIComponent(this.state.teamName)}
>
<span className='icon'/>
<span>
@@ -347,7 +347,7 @@ class SignupUserComplete extends React.Component {
defaultMessage='with Google'
/>
</span>
- </Link>
+ </a>
);
}
diff --git a/webapp/components/team_signup_with_sso.jsx b/webapp/components/team_signup_with_sso.jsx
index 9a46b2d6b..78396eea8 100644
--- a/webapp/components/team_signup_with_sso.jsx
+++ b/webapp/components/team_signup_with_sso.jsx
@@ -64,7 +64,7 @@ class SSOSignUpPage extends React.Component {
this.props.service,
(data) => {
if (data.follow_link) {
- browserHistory.push(data.follow_link);
+ window.location.href = data.follow_link;
} else {
browserHistory.push('/' + team.name + '/channels/town-square');
}
diff --git a/webapp/components/user_settings/user_settings_security.jsx b/webapp/components/user_settings/user_settings_security.jsx
index 283d2c425..f937844ec 100644
--- a/webapp/components/user_settings/user_settings_security.jsx
+++ b/webapp/components/user_settings/user_settings_security.jsx
@@ -416,6 +416,7 @@ class SecurityTab extends React.Component {
let numMethods = 0;
numMethods = global.window.mm_config.EnableSignUpWithGitLab === 'true' ? numMethods + 1 : numMethods;
numMethods = global.window.mm_config.EnableSignUpWithGoogle === 'true' ? numMethods + 1 : numMethods;
+ numMethods = global.window.mm_config.EnableLdap === 'true' ? numMethods + 1 : numMethods;
if (global.window.mm_config.EnableSignUpWithEmail && numMethods > 0) {
signInSection = this.createSignInSection();