Merge pull request #2465 from mattermost/plt-2260

PLT-2260 Add the ability to switch from email to ldap and back
Этот коммит содержится в:
Christopher Speller
2016-03-23 16:26:37 -04:00
родитель 6285ec44bb 934c7c7a7c
Коммит 07bf7c498d
20 изменённых файлов: 927 добавлений и 225 удалений

Просмотреть файл

@@ -256,38 +256,72 @@ export function resetPassword(data, success, error) {
track('api', 'api_users_reset_password');
}
export function switchToSSO(data, success, error) {
export function emailToOAuth(data, success, error) {
$.ajax({
url: '/api/v1/users/switch_to_sso',
url: '/api/v1/users/claim/email_to_oauth',
dataType: 'json',
contentType: 'application/json',
type: 'POST',
data: JSON.stringify(data),
success,
error: function onError(xhr, status, err) {
var e = handleError('switchToSSO', xhr, status, err);
var e = handleError('emailToOAuth', xhr, status, err);
error(e);
}
});
track('api', 'api_users_switch_to_sso');
track('api', 'api_users_email_to_oauth');
}
export function switchToEmail(data, success, error) {
export function oauthToEmail(data, success, error) {
$.ajax({
url: '/api/v1/users/switch_to_email',
url: '/api/v1/users/claim/oauth_to_email',
dataType: 'json',
contentType: 'application/json',
type: 'POST',
data: JSON.stringify(data),
success,
error: function onError(xhr, status, err) {
var e = handleError('switchToEmail', xhr, status, err);
var e = handleError('oauthToEmail', xhr, status, err);
error(e);
}
});
track('api', 'api_users_switch_to_email');
track('api', 'api_users_oauth_to_email');
}
export function emailToLDAP(data, success, error) {
$.ajax({
url: '/api/v1/users/claim/email_to_ldap',
dataType: 'json',
contentType: 'application/json',
type: 'POST',
data: JSON.stringify(data),
success,
error: function onError(xhr, status, err) {
var e = handleError('emailToLDAP', xhr, status, err);
error(e);
}
});
track('api', 'api_users_email_to_ldap');
}
export function ldapToEmail(data, success, error) {
$.ajax({
url: '/api/v1/users/claim/ldap_to_email',
dataType: 'json',
contentType: 'application/json',
type: 'POST',
data: JSON.stringify(data),
success,
error: function onError(xhr, status, err) {
var e = handleError('ldapToEmail', xhr, status, err);
error(e);
}
});
track('api', 'api_users_ldap_to_email');
}
export function logout(success, error) {

Просмотреть файл

@@ -185,6 +185,7 @@ export default {
OFFTOPIC_CHANNEL: 'off-topic',
GITLAB_SERVICE: 'gitlab',
GOOGLE_SERVICE: 'google',
LDAP_SERVICE: 'ldap',
EMAIL_SERVICE: 'email',
SIGNIN_CHANGE: 'signin_change',
SIGNIN_VERIFIED: 'verified',