summaryrefslogtreecommitdiffstats
path: root/ll-auth-binding/htdocs/IdentityBinding.js
diff options
context:
space:
mode:
authorLoïc Collignon <loic.collignon@iot.bzh>2017-07-31 11:26:33 +0200
committerLoïc Collignon <loic.collignon@iot.bzh>2017-07-31 11:26:33 +0200
commit0de5dda373fc97aabbcab78f5c2abf02c7bd36d2 (patch)
tree48b623c376cc98ca8117d20ace15d2e72d94e1e5 /ll-auth-binding/htdocs/IdentityBinding.js
parenta94e451c1241146be5f1771a7bdfa8a1da2e20a1 (diff)
added some events to the API, like failure.
Change-Id: Ib102a729ab5666906edf19f24c04662a5c26fdba Signed-off-by: Loïc Collignon <loic.collignon@iot.bzh>
Diffstat (limited to 'll-auth-binding/htdocs/IdentityBinding.js')
-rw-r--r--ll-auth-binding/htdocs/IdentityBinding.js20
1 files changed, 18 insertions, 2 deletions
diff --git a/ll-auth-binding/htdocs/IdentityBinding.js b/ll-auth-binding/htdocs/IdentityBinding.js
index 5f9ea24..4d0d98f 100644
--- a/ll-auth-binding/htdocs/IdentityBinding.js
+++ b/ll-auth-binding/htdocs/IdentityBinding.js
@@ -53,8 +53,24 @@
}
function gotevent(obj) {
- console.log("gotevent:" + JSON.stringify(obj));
- document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
+ console.log("gotevent:" + JSON.stringify(obj));
+ document.getElementById("outevt").innerHTML = (evtidx++) +": "+JSON.stringify(obj);
+
+ document.getElementById("message").innerHTML = "";
+
+ if (obj.event == "ll-auth/login") {
+ document.getElementById("userid").innerHTML = obj.data.user;
+ document.getElementById("device").innerHTML = obj.data.device;
+ }
+
+ if (obj.event == "ll-auth/logout") {
+ document.getElementById("userid").innerHTML = "";
+ document.getElementById("device").innerHTML = "";
+ }
+
+ if (obj.event == "ll-auth/failed") {
+ document.getElementById("message").innerHTML = obj.data.message;
+ }
}
function send(message) {