Fix MFA enforcement on login and page load (#6356)

Этот коммит содержится в:
Joram Wilander
2017-05-09 07:48:57 -05:00
коммит произвёл GitHub
родитель fb4d72bd8a
Коммит 202c383d8d
5 изменённых файлов: 20 добавлений и 6 удалений

Просмотреть файл

@@ -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
}
}