Disable user registration with a flag
This commit is contained in:
@@ -8,13 +8,14 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Port string
|
||||
Store string
|
||||
StoreAddr string
|
||||
StoreUser string
|
||||
StorePass string
|
||||
SecretA string
|
||||
SecretB string
|
||||
Port string
|
||||
Store string
|
||||
StoreAddr string
|
||||
StoreUser string
|
||||
StorePass string
|
||||
SecretA string
|
||||
SecretB string
|
||||
UserRegistration bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -39,6 +40,7 @@ func Refresh() {
|
||||
as.Append(args.STRING, "storeAddr", "addr of DB", "/tmp/oauth2server.db")
|
||||
as.Append(args.STRING, "storeUser", "user of DB", "")
|
||||
as.Append(args.STRING, "storePass", "pass of DB", "")
|
||||
as.Append(args.BOOL, "users", "allow user registration", false)
|
||||
if err := as.Parse(); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
@@ -50,4 +52,5 @@ func Refresh() {
|
||||
StorePass = as.Get("storepass").GetString()
|
||||
SecretA = as.Get("secreta").GetString()
|
||||
SecretB = as.Get("secretb").GetString()
|
||||
UserRegistration = as.Get("users").GetBool() || Store == "map"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user