From f248e29405d60d2ce2eb22264eb99509c674e36a Mon Sep 17 00:00:00 2001 From: coderaiser Date: Mon, 2 Apr 2018 10:57:46 +0300 Subject: [PATCH] fix(client) authCheck: can not connect via web sockets when auth disabled (#160) --- client/modules/config.js | 3 --- client/modules/edit-file.js | 3 --- client/modules/konsole.js | 3 --- client/modules/operation/index.js | 3 --- client/modules/terminal.js | 3 --- 5 files changed, 15 deletions(-) diff --git a/client/modules/config.js b/client/modules/config.js index 78e4dad4..9f7c5758 100644 --- a/client/modules/config.js +++ b/client/modules/config.js @@ -116,9 +116,6 @@ function initSocket() { } function authCheck(socket) { - if (!config('auth')) - return; - socket.emit('auth', config('username'), config('password')); socket.on('reject', () => { diff --git a/client/modules/edit-file.js b/client/modules/edit-file.js index 41f01ec9..2caf4369 100644 --- a/client/modules/edit-file.js +++ b/client/modules/edit-file.js @@ -105,9 +105,6 @@ CloudCmd.EditFile = function EditFileProto(callback) { } function authCheck(spawn) { - if (!config('auth')) - return; - spawn.emit('auth', config('username'), config('password')); spawn.on('reject', () => { Dialog.alert(TITLE, 'Wrong credentials!'); diff --git a/client/modules/konsole.js b/client/modules/konsole.js index e64f9a91..2269fd51 100644 --- a/client/modules/konsole.js +++ b/client/modules/konsole.js @@ -118,9 +118,6 @@ function ConsoleProto() { } function authCheck(spawn) { - if (!config('auth')) - return; - spawn.emit('auth', config('username'), config('password')); spawn.on('reject', () => { diff --git a/client/modules/operation/index.js b/client/modules/operation/index.js index 371882fd..2afc8610 100644 --- a/client/modules/operation/index.js +++ b/client/modules/operation/index.js @@ -77,9 +77,6 @@ function OperationProto(operation, data) { const accept = wraptile(ok); const alertDialog = wraptile(Dialog.alert); - if (!config('auth')) - return ok(spawn); - spawn.on('accept', accept(spawn)); spawn.on('reject', alertDialog (TITLE, 'Wrong credentials!')); spawn.emit('auth', config('username'), config('password')); diff --git a/client/modules/terminal.js b/client/modules/terminal.js index 88d1d507..ac118b3f 100644 --- a/client/modules/terminal.js +++ b/client/modules/terminal.js @@ -91,9 +91,6 @@ function create(callback) { } function authCheck(spawn) { - if (!config('auth')) - return; - spawn.emit('auth', config('username'), config('password')); spawn.on('reject', () => {