Skip to content

Commit

Permalink
fixes 'ubus' call, removes password caching
Browse files Browse the repository at this point in the history
  • Loading branch information
HipsterBrown committed Jan 31, 2016
1 parent c8e557f commit 03184ba
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion node/tessel-export.js
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,7 @@ Tessel.Wifi.prototype.connect = function(settings, callback) {
}

if (!settings.password && (!settings.security || settings.security === 'none')) {
settings.password = '';
settings.security = 'none';
}

Expand All @@ -1072,6 +1073,8 @@ Tessel.Wifi.prototype.connect = function(settings, callback) {
.then(restartWifi)
.then(getWifiInfo)
.then((network) => {
delete settings.password;

this.settings = Object.assign(network, settings);
this.connected = true;
this.emit('connect', this.settings);
Expand Down Expand Up @@ -1166,7 +1169,7 @@ function restartWifi() {

function getWifiInfo() {
return new Promise((resolve, reject) => {
childProcess.exec('ubus call iwinfo info {"device":"wlan0"}', (error, results) => {
childProcess.exec(`ubus call iwinfo info '{"device":"wlan0"}'`, (error, results) => {
if (error) {
throw error;
}
Expand Down

0 comments on commit 03184ba

Please sign in to comment.