@@ -707,7 +707,7 @@ func oAuth2UserLoginCallback(loginSource *models.LoginSource, request *http.Requ
707707
708708// LinkAccount shows the page where the user can decide to login or create a new account
709709func LinkAccount (ctx * context.Context ) {
710- ctx .Data ["DisablePassword" ] = ! setting .Service .RequireExternalRegistrationCaptcha || setting .Service .AllowOnlyExternalRegistration
710+ ctx .Data ["DisablePassword" ] = ! setting .Service .RequireExternalRegistrationPassword || setting .Service .AllowOnlyExternalRegistration
711711 ctx .Data ["Title" ] = ctx .Tr ("link_account" )
712712 ctx .Data ["LinkAccountMode" ] = true
713713 ctx .Data ["EnableCaptcha" ] = setting .Service .EnableCaptcha && setting .Service .RequireExternalRegistrationCaptcha
@@ -757,7 +757,7 @@ func LinkAccount(ctx *context.Context) {
757757
758758// LinkAccountPostSignIn handle the coupling of external account with another account using signIn
759759func LinkAccountPostSignIn (ctx * context.Context , signInForm auth.SignInForm ) {
760- ctx .Data ["DisablePassword" ] = setting .Service .AllowOnlyExternalRegistration
760+ ctx .Data ["DisablePassword" ] = ! setting . Service . RequireExternalRegistrationPassword || setting .Service .AllowOnlyExternalRegistration
761761 ctx .Data ["Title" ] = ctx .Tr ("link_account" )
762762 ctx .Data ["LinkAccountMode" ] = true
763763 ctx .Data ["LinkAccountModeSignIn" ] = true
@@ -840,7 +840,7 @@ func LinkAccountPostSignIn(ctx *context.Context, signInForm auth.SignInForm) {
840840func LinkAccountPostRegister (ctx * context.Context , cpt * captcha.Captcha , form auth.RegisterForm ) {
841841 // TODO Make insecure passwords optional for local accounts also,
842842 // once email-based Second-Factor Auth is available
843- ctx .Data ["DisablePassword" ] = ! setting .Service .RequireExternalRegistrationCaptcha || setting .Service .AllowOnlyExternalRegistration
843+ ctx .Data ["DisablePassword" ] = ! setting .Service .RequireExternalRegistrationPassword || setting .Service .AllowOnlyExternalRegistration
844844 ctx .Data ["Title" ] = ctx .Tr ("link_account" )
845845 ctx .Data ["LinkAccountMode" ] = true
846846 ctx .Data ["LinkAccountModeRegister" ] = true
0 commit comments