diff options
Diffstat (limited to 'api4/context.go')
-rw-r--r-- | api4/context.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/api4/context.go b/api4/context.go index 32db0ed7d..37af2c6d4 100644 --- a/api4/context.go +++ b/api4/context.go @@ -271,9 +271,13 @@ func (c *Context) MfaRequired() { return } + // Special case to let user get themself + if c.Path == "/api/v4/users/me" { + return + } + if !user.MfaActive { - c.Err = model.NewLocAppError("", "api.context.mfa_required.app_error", nil, "MfaRequired") - c.Err.StatusCode = http.StatusUnauthorized + c.Err = model.NewAppError("", "api.context.mfa_required.app_error", nil, "MfaRequired", http.StatusForbidden) return } } |