summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--api/oauth.go7
-rw-r--r--api/user.go2
-rw-r--r--webapp/action_creators/websocket_actions.jsx19
-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.jsx2
-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
-rw-r--r--webapp/stores/notification_store.jsx (renamed from webapp/stores/notificaiton_store.jsx)0
10 files changed, 45 insertions, 26 deletions
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/webapp/action_creators/websocket_actions.jsx b/webapp/action_creators/websocket_actions.jsx
index 611d53bf7..bb46db149 100644
--- a/webapp/action_creators/websocket_actions.jsx
+++ b/webapp/action_creators/websocket_actions.jsx
@@ -7,6 +7,7 @@ import PostStore from 'stores/post_store.jsx';
import ChannelStore from 'stores/channel_store.jsx';
import BrowserStore from 'stores/browser_store.jsx';
import ErrorStore from 'stores/error_store.jsx';
+import NotificationStore from 'stores/notification_store.jsx'; //eslint-disable-line no-unused-vars
import * as Utils from 'utils/utils.jsx';
import * as AsyncClient from 'utils/async_client.jsx';
@@ -21,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) {
@@ -35,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 = () => {
@@ -69,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) => {
@@ -147,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..d21f4d7a9 100644
--- a/webapp/components/signup_team_complete/components/signup_team_complete.jsx
+++ b/webapp/components/signup_team_complete/components/signup_team_complete.jsx
@@ -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();
diff --git a/webapp/stores/notificaiton_store.jsx b/webapp/stores/notification_store.jsx
index 70caffeb6..70caffeb6 100644
--- a/webapp/stores/notificaiton_store.jsx
+++ b/webapp/stores/notification_store.jsx