From 7e98cd58dd670fd83c0ace5e9c8ef9a0407fd575 Mon Sep 17 00:00:00 2001 From: zeripath Date: Mon, 27 Sep 2021 02:02:01 +0100 Subject: Add SkipLocal2FA option to pam and smtp sources (#17078) * Add SkipLocal2FA option to other pam and smtp sources Extend #16954 to allow setting skip local 2fa on pam and SMTP authentication sources Signed-off-by: Andrew Thornton * make SkipLocal2FA omitempty Signed-off-by: Andrew Thornton Co-authored-by: 6543 <6543@obermui.de> --- routers/web/admin/auths.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'routers/web/admin/auths.go') diff --git a/routers/web/admin/auths.go b/routers/web/admin/auths.go index 1b005e5c7b..a394b4fdc2 100644 --- a/routers/web/admin/auths.go +++ b/routers/web/admin/auths.go @@ -161,6 +161,7 @@ func parseSMTPConfig(form forms.AuthenticationForm) *smtp.Source { SkipVerify: form.SkipVerify, HeloHostname: form.HeloHostname, DisableHelo: form.DisableHelo, + SkipLocalTwoFA: form.SkipLocalTwoFA, } } @@ -244,8 +245,9 @@ func NewAuthSourcePost(ctx *context.Context) { hasTLS = true case login.PAM: config = &pamService.Source{ - ServiceName: form.PAMServiceName, - EmailDomain: form.PAMEmailDomain, + ServiceName: form.PAMServiceName, + EmailDomain: form.PAMEmailDomain, + SkipLocalTwoFA: form.SkipLocalTwoFA, } case login.OAuth2: config = parseOAuth2Config(form) -- cgit v1.2.3