From 3ef26de2ac9789407cb94d5ae5a50234966535b4 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Wed, 10 Aug 2016 15:20:18 -0400 Subject: [PATCH 1/4] Marked Office 365 SSO through OAuth2 as beta (#3781) --- webapp/components/admin_console/oauth_settings.jsx | 2 +- webapp/i18n/en.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/components/admin_console/oauth_settings.jsx b/webapp/components/admin_console/oauth_settings.jsx index 92663ece83..1f377bcc30 100644 --- a/webapp/components/admin_console/oauth_settings.jsx +++ b/webapp/components/admin_console/oauth_settings.jsx @@ -406,7 +406,7 @@ export default class OAuthSettings extends AdminSettings { oauthTypes.push({value: Constants.GOOGLE_SERVICE, text: Utils.localizeMessage('admin.oauth.google', 'Google Apps')}); } if (global.window.mm_license.Office365SSO === 'true') { - oauthTypes.push({value: Constants.OFFICE365_SERVICE, text: Utils.localizeMessage('admin.oauth.office365', 'Office 365')}); + oauthTypes.push({value: Constants.OFFICE365_SERVICE, text: Utils.localizeMessage('admin.oauth.office365', 'Office 365 (Beta)')}); } } diff --git a/webapp/i18n/en.json b/webapp/i18n/en.json index 478fbf362f..b37b7a5d5d 100644 --- a/webapp/i18n/en.json +++ b/webapp/i18n/en.json @@ -477,7 +477,7 @@ "admin.oauth.gitlab": "GitLab", "admin.oauth.google": "Google Apps", "admin.oauth.off": "Do not allow sign-in via an OAuth 2.0 provider", - "admin.oauth.office365": "Office 365", + "admin.oauth.office365": "Office 365 (Beta)", "admin.oauth.providerDescription": "When true, Mattermost can act as an OAuth 2.0 service provider allowing Mattermost to authorize API requests from external applications.", "admin.oauth.providerTitle": "Enable OAuth 2.0 Service Provider: ", "admin.oauth.select": "Select OAuth 2.0 service provider:", From b523f9867533a0294f8a96ad35d8340838fdab32 Mon Sep 17 00:00:00 2001 From: enahum Date: Wed, 10 Aug 2016 14:20:31 -0500 Subject: [PATCH 2/4] PLT-3879 Fix OAuth provider routes (#3780) --- api/oauth.go | 6 ++---- model/client.go | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/api/oauth.go b/api/oauth.go index fe2ecf1662..546b0bdcac 100644 --- a/api/oauth.go +++ b/api/oauth.go @@ -33,11 +33,9 @@ func InitOAuth() { BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/complete", AppHandlerIndependent(completeOAuth)).Methods("GET") BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/login", AppHandlerIndependent(loginWithOAuth)).Methods("GET") BaseRoutes.OAuth.Handle("/{service:[A-Za-z0-9]+}/signup", AppHandlerIndependent(signupWithOAuth)).Methods("GET") - BaseRoutes.OAuth.Handle("/authorize", AppHandlerTrustRequester(authorizeOAuth)).Methods("GET") - BaseRoutes.OAuth.Handle("/access_token", ApiAppHandlerTrustRequester(getAccessToken)).Methods("POST") - BaseRoutes.Root.Handle("/authorize", AppHandlerTrustRequester(authorizeOAuth)).Methods("GET") - BaseRoutes.Root.Handle("/access_token", ApiAppHandlerTrustRequester(getAccessToken)).Methods("POST") + BaseRoutes.Root.Handle("/oauth/authorize", AppHandlerTrustRequester(authorizeOAuth)).Methods("GET") + BaseRoutes.Root.Handle("/oauth/access_token", ApiAppHandlerTrustRequester(getAccessToken)).Methods("POST") // Handle all the old routes, to be later removed BaseRoutes.Root.Handle("/{service:[A-Za-z0-9]+}/complete", AppHandlerIndependent(completeOAuth)).Methods("GET") diff --git a/model/client.go b/model/client.go index 3aff3c9311..2d154e49f9 100644 --- a/model/client.go +++ b/model/client.go @@ -1533,7 +1533,7 @@ func (c *Client) DeleteOAuthApp(id string) (*Result, *AppError) { } func (c *Client) GetAccessToken(data url.Values) (*Result, *AppError) { - if r, err := c.DoPost(API_URL_SUFFIX+"/oauth/access_token", data.Encode(), "application/x-www-form-urlencoded"); err != nil { + if r, err := c.DoPost("/oauth/access_token", data.Encode(), "application/x-www-form-urlencoded"); err != nil { return nil, err } else { defer closeBody(r) From 379efb0a33d12b2540440b2a6c540265c542d97c Mon Sep 17 00:00:00 2001 From: David Lu Date: Wed, 10 Aug 2016 15:20:44 -0400 Subject: [PATCH 3/4] PLT-3846 Fixed loading screen not disappearing upon joining team (#3779) * fixed loading screen not disappearing upon joining team * Update signup_user_complete.jsx --- webapp/components/signup_user_complete.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/webapp/components/signup_user_complete.jsx b/webapp/components/signup_user_complete.jsx index eec143996f..4c2668ece7 100644 --- a/webapp/components/signup_user_complete.jsx +++ b/webapp/components/signup_user_complete.jsx @@ -69,12 +69,12 @@ export default class SignupUserComplete extends React.Component { if ((inviteId && inviteId.length > 0) || (hash && hash.length > 0)) { // if we are already logged in then attempt to just join the team if (UserStore.getCurrentUser()) { - loading = true; Client.addUserToTeamFromInvite( data, hash, inviteId, (team) => { + loading = true; GlobalActions.emitInitialLoad( () => { browserHistory.push('/' + team.name); @@ -111,14 +111,12 @@ export default class SignupUserComplete extends React.Component { serverError: null, teamDisplayName: inviteData.display_name, teamName: inviteData.name, - teamId: inviteData.id, - loading: false + teamId: inviteData.id }); }, () => { this.setState({ noOpenServerError: true, - loading: false, serverError: , - loading: false + /> }); } From bd106bb4018ab71dc1bc973d562bcda3dfbb6868 Mon Sep 17 00:00:00 2001 From: David Lu Date: Wed, 10 Aug 2016 15:20:52 -0400 Subject: [PATCH 4/4] fixed password reset salt broken (#3778) --- .../admin_console/password_settings.jsx | 99 ++++++++++--------- 1 file changed, 53 insertions(+), 46 deletions(-) diff --git a/webapp/components/admin_console/password_settings.jsx b/webapp/components/admin_console/password_settings.jsx index 20de8580fc..7b312b0f4b 100644 --- a/webapp/components/admin_console/password_settings.jsx +++ b/webapp/components/admin_console/password_settings.jsx @@ -34,28 +34,31 @@ export default class PasswordSettings extends AdminSettings { }); // Update sample message from config settings - let sampleErrorMsgId = 'user.settings.security.passwordError'; - if (props.config.PasswordSettings.Lowercase) { - sampleErrorMsgId = sampleErrorMsgId + 'Lowercase'; + this.sampleErrorMsg = null; + if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.PasswordRequirements === 'true') { + let sampleErrorMsgId = 'user.settings.security.passwordError'; + if (props.config.PasswordSettings.Lowercase) { + sampleErrorMsgId = sampleErrorMsgId + 'Lowercase'; + } + if (props.config.PasswordSettings.Uppercase) { + sampleErrorMsgId = sampleErrorMsgId + 'Uppercase'; + } + if (props.config.PasswordSettings.Number) { + sampleErrorMsgId = sampleErrorMsgId + 'Number'; + } + if (props.config.PasswordSettings.Symbol) { + sampleErrorMsgId = sampleErrorMsgId + 'Symbol'; + } + this.sampleErrorMsg = ( + + ); } - if (props.config.PasswordSettings.Uppercase) { - sampleErrorMsgId = sampleErrorMsgId + 'Uppercase'; - } - if (props.config.PasswordSettings.Number) { - sampleErrorMsgId = sampleErrorMsgId + 'Number'; - } - if (props.config.PasswordSettings.Symbol) { - sampleErrorMsgId = sampleErrorMsgId + 'Symbol'; - } - this.sampleErrorMsg = ( - - ); } componentWillUpdate() { @@ -94,37 +97,41 @@ export default class PasswordSettings extends AdminSettings { } getSampleErrorMsg() { - if (this.props.config.PasswordSettings.MinimumLength > Constants.MAX_PASSWORD_LENGTH || this.props.config.PasswordSettings.MinimumLength < Constants.MIN_PASSWORD_LENGTH) { + if (global.window.mm_license.IsLicensed === 'true' && global.window.mm_license.PasswordRequirements === 'true') { + if (this.props.config.PasswordSettings.MinimumLength > Constants.MAX_PASSWORD_LENGTH || this.props.config.PasswordSettings.MinimumLength < Constants.MIN_PASSWORD_LENGTH) { + return ( + + ); + } + + let sampleErrorMsgId = 'user.settings.security.passwordError'; + if (this.refs.lowercase.checked) { + sampleErrorMsgId = sampleErrorMsgId + 'Lowercase'; + } + if (this.refs.uppercase.checked) { + sampleErrorMsgId = sampleErrorMsgId + 'Uppercase'; + } + if (this.refs.number.checked) { + sampleErrorMsgId = sampleErrorMsgId + 'Number'; + } + if (this.refs.symbol.checked) { + sampleErrorMsgId = sampleErrorMsgId + 'Symbol'; + } return ( ); } - let sampleErrorMsgId = 'user.settings.security.passwordError'; - if (this.refs.lowercase.checked) { - sampleErrorMsgId = sampleErrorMsgId + 'Lowercase'; - } - if (this.refs.uppercase.checked) { - sampleErrorMsgId = sampleErrorMsgId + 'Uppercase'; - } - if (this.refs.number.checked) { - sampleErrorMsgId = sampleErrorMsgId + 'Number'; - } - if (this.refs.symbol.checked) { - sampleErrorMsgId = sampleErrorMsgId + 'Symbol'; - } - return ( - - ); + return null; } renderTitle() {