summaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorenahum <nahumhbl@gmail.com>2016-06-21 10:49:48 -0300
committerCorey Hulen <corey@hulen.com>2016-06-21 05:49:48 -0800
commite6fcea8459cad2e3b89fec590b37dcc4daaf687c (patch)
treeab187c563cb47c3cca7d3c57633398823eb907fe /api
parenta0bc947356e9f48f36ba3e7fe3e87a7d0c7125f9 (diff)
downloadchat-e6fcea8459cad2e3b89fec590b37dcc4daaf687c.tar.gz
chat-e6fcea8459cad2e3b89fec590b37dcc4daaf687c.tar.bz2
chat-e6fcea8459cad2e3b89fec590b37dcc4daaf687c.zip
PLT-3261 Fix Can't create a team with GitLab if the email domain is restricted (#3379)
Diffstat (limited to 'api')
-rw-r--r--api/team.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/api/team.go b/api/team.go
index 46bff617b..0f7298b57 100644
--- a/api/team.go
+++ b/api/team.go
@@ -300,6 +300,13 @@ func isTeamCreationAllowed(c *Context, email string) bool {
return false
}
+ if result := <-Srv.Store.User().GetByEmail(email); result.Err == nil {
+ user := result.Data.(*model.User)
+ if len(user.AuthService) > 0 && len(*user.AuthData) > 0 {
+ return true
+ }
+ }
+
// commas and @ signs are optional
// can be in the form of "@corp.mattermost.com, mattermost.com mattermost.org" -> corp.mattermost.com mattermost.com mattermost.org
domains := strings.Fields(strings.TrimSpace(strings.ToLower(strings.Replace(strings.Replace(utils.Cfg.TeamSettings.RestrictCreationToDomains, "@", " ", -1), ",", " ", -1))))