summaryrefslogtreecommitdiff
path: root/ui/app/lib
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2016-09-29 17:00:47 -0700
committerelijah <elijah@riseup.net>2016-09-29 17:00:47 -0700
commit10b0b4462107ecebffab4ce3eb0435d3c1b2dd24 (patch)
tree14ae6e69e56f53eacb299d59b0f6a1beda3063b8 /ui/app/lib
parente7281dd47f375c1b0a72ae85505319c4d87fb524 (diff)
[feat] ui - allow users to change their passwords
Diffstat (limited to 'ui/app/lib')
-rw-r--r--ui/app/lib/bitmask.js16
-rw-r--r--ui/app/lib/common.js4
2 files changed, 11 insertions, 9 deletions
diff --git a/ui/app/lib/bitmask.js b/ui/app/lib/bitmask.js
index 71a34f4a..10e678ee 100644
--- a/ui/app/lib/bitmask.js
+++ b/ui/app/lib/bitmask.js
@@ -41,7 +41,7 @@ var bitmask = function(){
if (window.location.protocol === "file:") {
api_url = 'http://localhost:7070/API/';
}
-
+
function call(command) {
var url = api_url + command.slice(0, 2).join('/');
var data = JSON.stringify(command.slice(2));
@@ -49,7 +49,7 @@ var bitmask = function(){
return new Promise(function(resolve, reject) {
var req = new XMLHttpRequest();
req.open('POST', url);
-
+
req.onload = function() {
if (req.status == 200) {
parseResponse(req.response, resolve, reject);
@@ -58,11 +58,11 @@ var bitmask = function(){
reject(Error(req.statusText));
}
};
-
+
req.onerror = function() {
reject(Error("Network Error"));
};
-
+
req.send(data);
});
};
@@ -79,8 +79,8 @@ var bitmask = function(){
function event_polling() {
call(['events', 'poll']).then(function(response) {
if (response !== null) {
- evnt = response[0];
- content = response[1];
+ var evnt = response[0];
+ var content = response[1];
if (evnt in event_handlers) {
event_handlers[evnt](evnt, content);
}
@@ -176,7 +176,7 @@ var bitmask = function(){
uid = "";
}
return call(['bonafide', 'user', 'logout', uid]);
- }
+ },
/**
* Change password
@@ -187,7 +187,7 @@ var bitmask = function(){
*/
update: function(uid, current_password, new_password) {
return call(['bonafide', 'user', 'update', uid, current_password, new_password]);
- },
+ }
}
},
diff --git a/ui/app/lib/common.js b/ui/app/lib/common.js
index 14a30c32..d1485ce7 100644
--- a/ui/app/lib/common.js
+++ b/ui/app/lib/common.js
@@ -4,4 +4,6 @@
import React from 'react'
-window.elem = React.createElement \ No newline at end of file
+window.elem = React.createElement
+
+window.log = console.log \ No newline at end of file