diff options
Diffstat (limited to 'webapp/actions/admin_actions.jsx')
-rw-r--r-- | webapp/actions/admin_actions.jsx | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/webapp/actions/admin_actions.jsx b/webapp/actions/admin_actions.jsx index 307f0c4a7..b9580c746 100644 --- a/webapp/actions/admin_actions.jsx +++ b/webapp/actions/admin_actions.jsx @@ -1,16 +1,18 @@ // Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. -import Client from 'client/web_client.jsx'; - import {clientLogout} from 'actions/global_actions.jsx'; +import Client from 'client/web_client.jsx'; + import store from 'stores/redux_store.jsx'; const dispatch = store.dispatch; const getState = store.getState; import * as AdminActions from 'mattermost-redux/actions/admin'; import * as UserActions from 'mattermost-redux/actions/users'; +import * as IntegrationActions from 'mattermost-redux/actions/integrations'; +import {Client4} from 'mattermost-redux/client'; export function saveConfig(config, success, error) { AdminActions.updateConfig(config)(dispatch, getState).then( @@ -157,13 +159,13 @@ export function ldapSyncNow(success, error) { } export function getOAuthAppInfo(clientId, success, error) { - Client.getOAuthAppInfo( - clientId, + Client4.getOAuthAppInfo(clientId).then( (data) => { if (success) { success(data); } - }, + } + ).catch( (err) => { if (error) { error(err); @@ -179,12 +181,13 @@ export function allowOAuth2(params, success, error) { const state = params.state; const scope = params.scope; - Client.allowOAuth2(responseType, clientId, redirectUri, state, scope, + Client4.authorizeOAuthApp(responseType, clientId, redirectUri, state, scope).then( (data) => { if (success) { success(data); } - }, + } + ).catch( (err) => { if (error) { error(err); @@ -238,16 +241,13 @@ export function oauthToEmail(currentService, email, password, success, error) { } export function regenerateOAuthAppSecret(oauthAppId, success, error) { - Client.regenerateOAuthAppSecret( - oauthAppId, + IntegrationActions.regenOAuthAppSecret(oauthAppId)(dispatch, getState).then( (data) => { - if (success) { + if (data && success) { success(data); - } - }, - (err) => { - if (error) { - error(err); + } else if (data == null && error) { + const serverError = getState().requests.admin.updateOAuthApp.error; + error({id: serverError.server_error_id, ...serverError}); } } ); |