Add the ability to switch from email to ldap and back

Этот коммит содержится в:
JoramWilander
2016-03-17 15:46:16 -04:00
родитель 7af2e6f87a
Коммит 463fd8c20b
20 изменённых файлов: 933 добавлений и 231 удалений

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

@@ -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',