From 0de5dda373fc97aabbcab78f5c2abf02c7bd36d2 Mon Sep 17 00:00:00 2001 From: Loïc Collignon Date: Mon, 31 Jul 2017 11:26:33 +0200 Subject: added some events to the API, like failure. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ib102a729ab5666906edf19f24c04662a5c26fdba Signed-off-by: Loïc Collignon --- ll-auth-binding/htdocs/IdentityBinding.js | 20 ++++++++++++++++++-- ll-auth-binding/htdocs/auth.html | 14 ++++++++++++-- ll-auth-binding/htdocs/index.html | 1 + 3 files changed, 31 insertions(+), 4 deletions(-) (limited to 'll-auth-binding/htdocs') 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) { diff --git a/ll-auth-binding/htdocs/auth.html b/ll-auth-binding/htdocs/auth.html index 6e0da89..ac48ff9 100644 --- a/ll-auth-binding/htdocs/auth.html +++ b/ll-auth-binding/htdocs/auth.html @@ -17,12 +17,22 @@

  • +
    +
    +

    User:

    +
      +
    1. id:
    2. +
    3. device:
    4. +
    +
    +
    - \ No newline at end of file + diff --git a/ll-auth-binding/htdocs/index.html b/ll-auth-binding/htdocs/index.html index 5eb0401..1c90ae5 100644 --- a/ll-auth-binding/htdocs/index.html +++ b/ll-auth-binding/htdocs/index.html @@ -6,6 +6,7 @@

    Identity Binding tests

    1. Auth
    2. +
    3. Auth2
    -- cgit 1.2.3-korg