summaryrefslogtreecommitdiffstats
path: root/api4/context.go
diff options
context:
space:
mode:
Diffstat (limited to 'api4/context.go')
-rw-r--r--api4/context.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/api4/context.go b/api4/context.go
index 9c27ec9c1..cd1137508 100644
--- a/api4/context.go
+++ b/api4/context.go
@@ -242,8 +242,7 @@ func (c *Context) IsSystemAdmin() bool {
func (c *Context) SessionRequired() {
if len(c.Session.UserId) == 0 {
- c.Err = model.NewLocAppError("", "api.context.session_expired.app_error", nil, "UserRequired")
- c.Err.StatusCode = http.StatusUnauthorized
+ c.Err = model.NewAppError("", "api.context.session_expired.app_error", nil, "UserRequired", http.StatusUnauthorized)
return
}
}