feat:
* added disable playground functionality * added toggle button for playground in dashboard
This commit is contained in:
22
server/env/env.go
vendored
22
server/env/env.go
vendored
@@ -104,6 +104,7 @@ func InitAllEnv() error {
|
||||
osDisableStrongPassword := os.Getenv(constants.EnvKeyDisableStrongPassword)
|
||||
osEnforceMultiFactorAuthentication := os.Getenv(constants.EnvKeyEnforceMultiFactorAuthentication)
|
||||
osDisableMultiFactorAuthentication := os.Getenv(constants.EnvKeyDisableMultiFactorAuthentication)
|
||||
osDisablePlayground := os.Getenv(constants.EnvKeyDisablePlayGround)
|
||||
|
||||
// os slice vars
|
||||
osAllowedOrigins := os.Getenv(constants.EnvKeyAllowedOrigins)
|
||||
@@ -145,7 +146,7 @@ func InitAllEnv() error {
|
||||
if val, ok := envData[constants.EnvAwsRegion]; !ok || val == "" {
|
||||
envData[constants.EnvAwsRegion] = osAwsRegion
|
||||
}
|
||||
|
||||
|
||||
if osAwsRegion != "" && envData[constants.EnvAwsRegion] != osAwsRegion {
|
||||
envData[constants.EnvAwsRegion] = osAwsRegion
|
||||
}
|
||||
@@ -789,17 +790,17 @@ func InitAllEnv() error {
|
||||
envData[constants.EnvKeyTwilioAccountSID] = osTwilioAccountSid
|
||||
}
|
||||
|
||||
if osTwilioSenderFrom != "" && envData[constants.EnvKeyTwilioSenderFrom] != osTwilioSenderFrom {
|
||||
if osTwilioSenderFrom != "" && envData[constants.EnvKeyTwilioSenderFrom] != osTwilioSenderFrom {
|
||||
envData[constants.EnvKeyTwilioSenderFrom] = osTwilioSenderFrom
|
||||
}
|
||||
|
||||
if _, ok := envData[constants.EnvKeyDisablePhoneVerification]; !ok {
|
||||
envData[constants.EnvKeyDisablePhoneVerification] = osDisablePhoneVerification == "false"
|
||||
}
|
||||
|
||||
|
||||
if osDisablePhoneVerification != "" {
|
||||
boolValue, err := strconv.ParseBool(osDisablePhoneVerification)
|
||||
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -808,6 +809,19 @@ func InitAllEnv() error {
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := envData[constants.EnvKeyDisablePlayGround]; !ok {
|
||||
envData[constants.EnvKeyDisablePlayGround] = osDisablePlayground == "true"
|
||||
}
|
||||
if osDisablePlayground != "" {
|
||||
boolValue, err := strconv.ParseBool(osDisablePlayground)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if boolValue != envData[constants.EnvKeyDisablePlayGround].(bool) {
|
||||
envData[constants.EnvKeyDisablePlayGround] = boolValue
|
||||
}
|
||||
}
|
||||
|
||||
err = memorystore.Provider.UpdateEnvStore(envData)
|
||||
if err != nil {
|
||||
log.Debug("Error while updating env store: ", err)
|
||||
|
Reference in New Issue
Block a user