Skip to content

Commit

Permalink
Working on #1 - digest authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
ZachBenz committed Feb 17, 2014
1 parent 17271e5 commit e190f6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion node_modules/http-digest-client/http-digest-client.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 8 additions & 3 deletions src/js-pre-browserify/pebble-js-app-pre-browserify.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

var digest = require('http-digest-client').createDigestClient('username', 'password');
// Some things we need to define to get node.js modules to work
if (typeof window.location === "undefined") {
window.location = [];
}
if (typeof window.location.protocol === "undefined") {
window.location.protocol = "http:";
}

var MAX_DEVICE_NAME_LENGTH = 95; // 1 less than max on Pebble side to allow for strncpy to insert terminating null in strncpy
var MAX_ACTION_NAME_LENGTH = 95; // 1 less than max on Pebble side to allow for strncpy to insert terminating null in strncpy
Expand Down Expand Up @@ -74,13 +80,12 @@ console.log("prefixForGet is: " + prefixForGet);

// Set callback for the app ready event
Pebble.addEventListener("ready", function(e) {
console.log("connect!" + e.ready);
console.log("Ready: " + e.ready);
console.log(e.type);
});

Pebble.addEventListener("showConfiguration", function() {
console.log("showing configuration");
// Pebble.openURL('https://s3.amazonaws.com/IndigoRemote/settings.html?serverAddress=' + serverAddress + '&serverPort=' + serverPort);
var html = config_html.replace('__CONFIG__', JSON.stringify(config), 'g');
Pebble.openURL('data:text/html,' + encodeURI(html + '<!--.html'));
});
Expand Down

0 comments on commit e190f6f

Please sign in to comment.