diff options
Diffstat (limited to 'll-auth-binding/htdocs')
-rw-r--r-- | ll-auth-binding/htdocs/IdentityBinding.js | 20 | ||||
-rw-r--r-- | ll-auth-binding/htdocs/auth.html | 14 | ||||
-rw-r--r-- | ll-auth-binding/htdocs/index.html | 1 |
3 files changed, 31 insertions, 4 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) { 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 @@ <li><button onclick="callbinder('ll-auth','getuser', {})">get user</button></li> </ol> <br> + <div> + </div> + <h2>User:</h2> + <ol> + <li>id: <span id="userid"></span></li> + <li>device: <span id="device"></span></li> + </ol> + <div id="message" style="color:red;"></div> + <br/> <div id="main" style="visibility:hidden"> + <h2>Debug: </h2> <ol> <li>Question <div id="question"></div></li> <li>Response <div id="output"></div></li> - <li>Events: <div id="outevt"></div> + <li>Events: <div id="outevt"></div></li> </ol> </div> </body> -</html>
\ No newline at end of file +</html> 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 @@ <h1>Identity Binding tests</h1> <ol> <li><a href="auth.html">Auth</a></li> + <li><a href="auth2.html">Auth2</a></li> </ol> </body> </html> |