Browse Source

Set OpenID support on by default when installing new instance (#3010)

Sandro Santilli 2 years ago
parent
commit
67b0d2175d
2 changed files with 3 additions and 3 deletions
  1. 1 1
      modules/setting/setting.go
  2. 2 2
      routers/install.go

+ 1 - 1
modules/setting/setting.go

@@ -1165,7 +1165,7 @@ func newService() {
1165 1165
 	Service.NoReplyAddress = sec.Key("NO_REPLY_ADDRESS").MustString("noreply.example.org")
1166 1166
 
1167 1167
 	sec = Cfg.Section("openid")
1168
-	Service.EnableOpenIDSignIn = sec.Key("ENABLE_OPENID_SIGNIN").MustBool(false)
1168
+	Service.EnableOpenIDSignIn = sec.Key("ENABLE_OPENID_SIGNIN").MustBool(!InstallLock)
1169 1169
 	Service.EnableOpenIDSignUp = sec.Key("ENABLE_OPENID_SIGNUP").MustBool(!Service.DisableRegistration && Service.EnableOpenIDSignIn)
1170 1170
 	pats := sec.Key("WHITELISTED_URIS").Strings(" ")
1171 1171
 	if len(pats) != 0 {

+ 2 - 2
routers/install.go

@@ -108,8 +108,8 @@ func Install(ctx *context.Context) {
108 108
 	form.OfflineMode = setting.OfflineMode
109 109
 	form.DisableGravatar = setting.DisableGravatar
110 110
 	form.EnableFederatedAvatar = setting.EnableFederatedAvatar
111
-	form.EnableOpenIDSignIn = true
112
-	form.EnableOpenIDSignUp = true
111
+	form.EnableOpenIDSignIn = setting.Service.EnableOpenIDSignIn
112
+	form.EnableOpenIDSignUp = setting.Service.EnableOpenIDSignUp
113 113
 	form.DisableRegistration = setting.Service.DisableRegistration
114 114
 	form.EnableCaptcha = setting.Service.EnableCaptcha
115 115
 	form.RequireSignInView = setting.Service.RequireSignInView