summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-08-28 08:37:55 -0400
committerJoramWilander <jwawilander@gmail.com>2015-08-28 08:37:55 -0400
commitf5fec3a157e6c9146a0c4e28dd5f70e6c066affd (patch)
tree176afd630a3afbe0ac3389695be6b4ce1c45d069 /utils/config.go
parentdb7e8c12889485234fb2d1ba6556106e5fc7548b (diff)
downloadchat-f5fec3a157e6c9146a0c4e28dd5f70e6c066affd.tar.gz
chat-f5fec3a157e6c9146a0c4e28dd5f70e6c066affd.tar.bz2
chat-f5fec3a157e6c9146a0c4e28dd5f70e6c066affd.zip
Added the ability to create a team with SSO services and added the ability to turn off email sign up.
Diffstat (limited to 'utils/config.go')
-rw-r--r--utils/config.go19
1 files changed, 19 insertions, 0 deletions
diff --git a/utils/config.go b/utils/config.go
index 36301264c..36193412b 100644
--- a/utils/config.go
+++ b/utils/config.go
@@ -31,6 +31,7 @@ type ServiceSettings struct {
UseLocalStorage bool
StorageDirectory string
AllowedLoginAttempts int
+ AllowEmailSignUp bool
}
type SSOSetting struct {
@@ -277,5 +278,23 @@ func GetAllowedAuthServices() []string {
}
}
+ if Cfg.ServiceSettings.AllowEmailSignUp {
+ authServices = append(authServices, "email")
+ }
+
return authServices
}
+
+func IsServiceAllowed(s string) bool {
+ if len(s) == 0 {
+ return false
+ }
+
+ if service, ok := Cfg.SSOSettings[s]; ok {
+ if service.Allow {
+ return true
+ }
+ }
+
+ return false
+}