From 2f6b209174d0c8da228c469a1d7d067fdf758d86 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 15 Oct 2014 08:46:37 -0700 Subject: [PATCH 1/2] adding auth_token to ws request --- server/app/index.html | 2 +- server/app/scripts/services/feed.js | 3 ++- server/app/scripts/services/stdout.js | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/server/app/index.html b/server/app/index.html index f6d51842..fe60da6b 100644 --- a/server/app/index.html +++ b/server/app/index.html @@ -6,7 +6,7 @@ - + diff --git a/server/app/scripts/services/feed.js b/server/app/scripts/services/feed.js index 07cb1b77..8d3e085b 100644 --- a/server/app/scripts/services/feed.js +++ b/server/app/scripts/services/feed.js @@ -2,8 +2,9 @@ angular.module('app').service('feed', ['$http', '$window', function($http, $window) { + var token = localStorage.getItem('access_token'); var proto = ($window.location.protocol == 'https:' ? 'wss' : 'ws'); - var route = [proto, "://", $window.location.host, '/api/stream/user'].join(''); + var route = [proto, "://", $window.location.host, '/api/stream/user?access_token=', token].join(''); var wsCallback = undefined; var ws = new WebSocket(route); diff --git a/server/app/scripts/services/stdout.js b/server/app/scripts/services/stdout.js index 5fc439d0..894e2616 100644 --- a/server/app/scripts/services/stdout.js +++ b/server/app/scripts/services/stdout.js @@ -3,12 +3,13 @@ angular.module('app').service('stdout', ['$window', function($window) { var callback = undefined; var websocket = undefined; + var token = localStorage.getItem('access_token'); this.subscribe = function(path, _callback) { callback = _callback; var proto = ($window.location.protocol == 'https:' ? 'wss' : 'ws'); - var route = [proto, "://", $window.location.host, '/api/stream/stdout/', path].join(''); + var route = [proto, "://", $window.location.host, '/api/stream/stdout/', path, '?access_token=', token].join(''); websocket = new WebSocket(route); websocket.onmessage = function(event) { From 830d3d7d9ef3b9f08119d8c604126a770923acaa Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 15 Oct 2014 19:27:01 -0700 Subject: [PATCH 2/2] removed settings link --- server/app/views/drawer.html | 1 - 1 file changed, 1 deletion(-) diff --git a/server/app/views/drawer.html b/server/app/views/drawer.html index a7332e70..72d58fb4 100644 --- a/server/app/views/drawer.html +++ b/server/app/views/drawer.html @@ -5,7 +5,6 @@
  • Account
  • Users
  • -
  • Settings
  • Signout \ No newline at end of file