Skip to content

Commit

Permalink
Merge branch 'fix/properly-configure-cmd-panel' into 'master'
Browse files Browse the repository at this point in the history
fix: properly configure host in 'config panel' cmd

See merge request prey/js/prey-node-client!1039
  • Loading branch information
beregcamlost committed Aug 12, 2024
2 parents 33f7858 + 42ce63e commit 6a66157
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions lib/agent/control-panel/secure.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,6 @@ let privateKey;
let publicKey;
let publicKeys = {};

const protocol = config.getData('control-panel.protocol');
const host = config.getData('control-panel.host');
let panelHost;
switch (host) {
case 'solid.preyproject.com':
panelHost = 'panel.preyproject.com';
break;
case 'solid.preyhq.com':
panelHost = 'panel.preyhq.com';
break;
default:
panelHost = host;
break;
}
const base = `${protocol}://${panelHost}`;
const authUrl = `${base}/auth/configuration/start`;

const notifyLinked = (hardware) => {
if (!common.helpers.running_on_background()) return;
const data = {
Expand Down Expand Up @@ -144,6 +127,22 @@ exports.generate_keys = (cb) => {
};

exports.open_config = (deviceKey, cb) => {
const protocol = config.getData('control-panel.protocol');
const host = config.getData('control-panel.host');
let panelHost;
switch (host) {
case 'solid.preyproject.com':
panelHost = 'panel.preyproject.com';
break;
case 'solid.preyhq.com':
panelHost = 'panel.preyhq.com';
break;
default:
panelHost = host;
break;
}
const base = `${protocol}://${panelHost}`;
const authUrl = `${base}/auth/configuration/start`;
setTimeout(() => {
const lang = common.system.lang || 'en';

Expand Down

0 comments on commit 6a66157

Please sign in to comment.