From 4e7dbc3bb0e93bafa684594b19c5648dc030ee17 Mon Sep 17 00:00:00 2001 From: Ruzette Tanyag Date: Fri, 17 Feb 2017 10:31:01 -0500 Subject: Implement user sessions endpoints for APIv4 (#5449) * added get session and revoke session endpoints, unittests and drivers * removed BasicUser2 and added teardown * added badrequest unit test case for sessions * added session loop to check if user id and session user id matches * fixed indentation issues for user_test * match indentation from spaces to tabs --- app/session.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'app') diff --git a/app/session.go b/app/session.go index 83e5f343a..2207ed869 100644 --- a/app/session.go +++ b/app/session.go @@ -4,6 +4,7 @@ package app import ( + "net/http" "github.com/mattermost/platform/einterfaces" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" @@ -148,6 +149,7 @@ func RevokeSessionsForDeviceId(userId string, deviceId string, currentSessionId func RevokeSessionById(sessionId string) *model.AppError { if result := <-Srv.Store.Session().Get(sessionId); result.Err != nil { + result.Err.StatusCode = http.StatusBadRequest return result.Err } else { return RevokeSession(result.Data.(*model.Session)) -- cgit v1.2.3-1-g7c22