summaryrefslogtreecommitdiffstats
path: root/utils/config.go
diff options
context:
space:
mode:
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
+}