summaryrefslogtreecommitdiffstats
path: root/api4/context.go
diff options
context:
space:
mode:
authorJoram Wilander <jwawilander@gmail.com>2017-04-10 08:19:49 -0400
committerChristopher Speller <crspeller@gmail.com>2017-04-10 08:19:49 -0400
commitdfc6db737411bd4ad68a803be5182f06055a1769 (patch)
tree375d93b8d1d8b1384988dc708c9f337e0ea2366c /api4/context.go
parent7b77bcf87e85330a1f7f0b2a2dcbf71326bf2fba (diff)
downloadchat-dfc6db737411bd4ad68a803be5182f06055a1769.tar.gz
chat-dfc6db737411bd4ad68a803be5182f06055a1769.tar.bz2
chat-dfc6db737411bd4ad68a803be5182f06055a1769.zip
Refactor switching login type code into app layer and add v4 endpoint (#6000)
* Refactor switching login type code into app layer and add v4 endpoint * Fix unit test
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
}
}