mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 18:09:57 -03:30
Merge pull request #5095 from jaredevantabor/remove-token-from-sockets
removing token from websocket connection url
This commit is contained in:
commit
eada4ce83f
@ -5,8 +5,8 @@
|
||||
*************************************************/
|
||||
import ReconnectingWebSocket from 'reconnectingwebsocket';
|
||||
export default
|
||||
['$rootScope', '$location', '$log','$state', '$q', 'i18n', 'Authorization',
|
||||
function ($rootScope, $location, $log, $state, $q, i18n, Authorization) {
|
||||
['$rootScope', '$location', '$log','$state', '$q', 'i18n',
|
||||
function ($rootScope, $location, $log, $state, $q, i18n) {
|
||||
var needsResubscribing = false,
|
||||
socketPromise = $q.defer();
|
||||
return {
|
||||
@ -14,8 +14,7 @@ export default
|
||||
var self = this,
|
||||
host = window.location.host,
|
||||
protocol,
|
||||
url,
|
||||
token = Authorization.getToken();
|
||||
url;
|
||||
|
||||
if($location.protocol() === 'http'){
|
||||
protocol = 'ws';
|
||||
@ -26,8 +25,7 @@ export default
|
||||
url = `${protocol}://${host}/websocket/`;
|
||||
|
||||
if (!$rootScope.sessionTimer || ($rootScope.sessionTimer && !$rootScope.sessionTimer.isExpired())) {
|
||||
// We have a valid session token, so attempt socket connection
|
||||
url = `${url}?token=${token}`;
|
||||
|
||||
$log.debug('Socket connecting to: ' + url);
|
||||
|
||||
self.socket = new ReconnectingWebSocket(url, null, {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user