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
Этот коммит содержится в:
Joram Wilander
2017-04-10 08:19:49 -04:00
коммит произвёл Christopher Speller
родитель 7b77bcf87e
Коммит dfc6db7374
11 изменённых файлов: 494 добавлений и 284 удалений

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

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