From 316b155a42a4d00fb835438ce7e0401a64e59add Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Mon, 31 Oct 2016 08:59:23 -0400 Subject: PLT-3562 Switch websocket over to post-connect authentication (#4327) * Switch websocket over to post-connect authentication * Add ability to specify token in websocket js driver, add unit tests * Temporarily disable client websocket tests until issues are resolved * Minor refactoring and fix status test * Add isAuthenticated method to WebConn and minor status updates --- api/user_test.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'api/user_test.go') diff --git a/api/user_test.go b/api/user_test.go index 57f4729da..20c555931 100644 --- a/api/user_test.go +++ b/api/user_test.go @@ -1794,6 +1794,11 @@ func TestUserTyping(t *testing.T) { defer WebSocketClient.Close() WebSocketClient.Listen() + time.Sleep(300 * time.Millisecond) + if resp := <-WebSocketClient.ResponseChannel; resp.Status != model.STATUS_OK { + t.Fatal("should have responded OK to authentication challenge") + } + WebSocketClient.UserTyping("", "") time.Sleep(300 * time.Millisecond) if resp := <-WebSocketClient.ResponseChannel; resp.Error.Id != "api.websocket_handler.invalid_param.app_error" { -- cgit v1.2.3-1-g7c22