feat: Add option to disable builtin authentication.

Setting ENABLE_INTERNAL_SIGNIN to false will disable the built-in
signin form, should the administrator prefer to limit users to SSO.

Continuation of forgejo/forgejo#6076
This commit is contained in:
George Tsiamasiotis 2024-11-26 08:51:51 +02:00 committed by Squel
parent 48b91fa31a
commit a126477e86
6 changed files with 59 additions and 0 deletions

View file

@ -43,6 +43,7 @@ var Service = struct {
AllowOnlyInternalRegistration bool
AllowOnlyExternalRegistration bool
ShowRegistrationButton bool
EnableInternalSignIn bool
ShowMilestonesDashboardPage bool
RequireSignInView bool
EnableNotifyMail bool
@ -175,6 +176,7 @@ func loadServiceFrom(rootCfg ConfigProvider) {
Service.EmailDomainBlockList = append(Service.EmailDomainBlockList, toAdd...)
}
Service.ShowRegistrationButton = sec.Key("SHOW_REGISTRATION_BUTTON").MustBool(!(Service.DisableRegistration || Service.AllowOnlyExternalRegistration))
Service.EnableInternalSignIn = sec.Key("ENABLE_INTERNAL_SIGNIN").MustBool(true)
Service.ShowMilestonesDashboardPage = sec.Key("SHOW_MILESTONES_DASHBOARD_PAGE").MustBool(true)
Service.RequireSignInView = sec.Key("REQUIRE_SIGNIN_VIEW").MustBool()
Service.EnableBasicAuth = sec.Key("ENABLE_BASIC_AUTHENTICATION").MustBool(true)