summaryrefslogtreecommitdiffstats
path: root/api/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'api/context.go')
-rw-r--r--api/context.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/api/context.go b/api/context.go
index 0322b6c43..aa5f2a163 100644
--- a/api/context.go
+++ b/api/context.go
@@ -191,7 +191,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
c.Path = "/" + strings.Join(splitURL[2:], "/")
}
- if h.isApi && !*utils.Cfg.ServiceSettings.EnableAPIv3 {
+ if h.isApi && !*c.App.Config().ServiceSettings.EnableAPIv3 {
c.Err = model.NewAppError("ServeHTTP", "api.context.v3_disabled.app_error", nil, "", http.StatusNotImplemented)
}
@@ -229,7 +229,7 @@ func (h handler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
c.Err.Where = r.URL.Path
// Block out detailed error when not in developer mode
- if !*utils.Cfg.ServiceSettings.EnableDeveloper {
+ if !*c.App.Config().ServiceSettings.EnableDeveloper {
c.Err.DetailedError = ""
}
@@ -294,7 +294,7 @@ func (c *Context) LogDebug(err *model.AppError) {
}
func (c *Context) UserRequired() {
- if !*utils.Cfg.ServiceSettings.EnableUserAccessTokens && c.Session.Props[model.SESSION_PROP_TYPE] == model.SESSION_TYPE_USER_ACCESS_TOKEN {
+ if !*c.App.Config().ServiceSettings.EnableUserAccessTokens && c.Session.Props[model.SESSION_PROP_TYPE] == model.SESSION_TYPE_USER_ACCESS_TOKEN {
c.Err = model.NewAppError("", "api.context.session_expired.app_error", nil, "UserAccessToken", http.StatusUnauthorized)
return
}
@@ -307,7 +307,7 @@ func (c *Context) UserRequired() {
func (c *Context) MfaRequired() {
// Must be licensed for MFA and have it configured for enforcement
- if !utils.IsLicensed() || !*utils.License().Features.MFA || !*utils.Cfg.ServiceSettings.EnableMultifactorAuthentication || !*utils.Cfg.ServiceSettings.EnforceMultifactorAuthentication {
+ if !utils.IsLicensed() || !*utils.License().Features.MFA || !*c.App.Config().ServiceSettings.EnableMultifactorAuthentication || !*c.App.Config().ServiceSettings.EnforceMultifactorAuthentication {
return
}