summaryrefslogtreecommitdiffstats
path: root/web/react/utils
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-08-28 09:14:37 -0400
committerChristopher Speller <crspeller@gmail.com>2015-08-28 09:14:37 -0400
commit75af5d4536cc414d171c2fe6dca78e455eb18b37 (patch)
tree4e00cf97b5f4f570b1901093bfa4e208749932a0 /web/react/utils
parentd107b392a6309a41eac6cd7d07d720a21968eb56 (diff)
parentf5fec3a157e6c9146a0c4e28dd5f70e6c066affd (diff)
downloadchat-75af5d4536cc414d171c2fe6dca78e455eb18b37.tar.gz
chat-75af5d4536cc414d171c2fe6dca78e455eb18b37.tar.bz2
chat-75af5d4536cc414d171c2fe6dca78e455eb18b37.zip
Merge pull request #496 from mattermost/mm-2015
MM-2015 Added the ability to create a team with SSO services and added the ability to turn off email sign up.
Diffstat (limited to 'web/react/utils')
-rw-r--r--web/react/utils/client.jsx15
-rw-r--r--web/react/utils/constants.jsx1
2 files changed, 16 insertions, 0 deletions
diff --git a/web/react/utils/client.jsx b/web/react/utils/client.jsx
index 70220c71e..082f82a08 100644
--- a/web/react/utils/client.jsx
+++ b/web/react/utils/client.jsx
@@ -70,6 +70,21 @@ module.exports.createTeamFromSignup = function(teamSignup, success, error) {
});
};
+module.exports.createTeamWithSSO = function(team, service, success, error) {
+ $.ajax({
+ url: '/api/v1/teams/create_with_sso/' + service,
+ dataType: 'json',
+ contentType: 'application/json',
+ type: 'POST',
+ data: JSON.stringify(team),
+ success: success,
+ error: function onError(xhr, status, err) {
+ var e = handleError('createTeamWithSSO', xhr, status, err);
+ error(e);
+ }
+ });
+};
+
module.exports.createUser = function(user, data, emailHash, success, error) {
$.ajax({
url: '/api/v1/users/create?d=' + encodeURIComponent(data) + '&h=' + encodeURIComponent(emailHash),
diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx
index 82fc3da22..6678790e2 100644
--- a/web/react/utils/constants.jsx
+++ b/web/react/utils/constants.jsx
@@ -61,6 +61,7 @@ module.exports = {
OFFTOPIC_CHANNEL: 'off-topic',
GITLAB_SERVICE: 'gitlab',
GOOGLE_SERVICE: 'google',
+ EMAIL_SERVICE: 'email',
POST_CHUNK_SIZE: 60,
MAX_POST_CHUNKS: 3,
POST_LOADING: 'loading',