diff options
Diffstat (limited to 'modules/context/auth.go')
-rw-r--r-- | modules/context/auth.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/context/auth.go b/modules/context/auth.go index ed220d5420..0a62b2741e 100644 --- a/modules/context/auth.go +++ b/modules/context/auth.go @@ -151,6 +151,9 @@ func ToggleAPI(options *ToggleOptions) func(ctx *APIContext) { return } if ctx.IsSigned && ctx.IsBasicAuth { + if skip, ok := ctx.Data["SkipLocalTwoFA"]; ok && skip.(bool) { + return // Skip 2FA + } twofa, err := models.GetTwoFactorByUID(ctx.User.ID) if err != nil { if models.IsErrTwoFactorNotEnrolled(err) { |