diff options
Diffstat (limited to 'src/client/js')
-rw-r--r-- | src/client/js/main.js | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/client/js/main.js b/src/client/js/main.js index 2704746..bdcb479 100644 --- a/src/client/js/main.js +++ b/src/client/js/main.js @@ -1,15 +1,13 @@ -var app = Elm.fullscreen(Elm.Main, { +Elm.fullscreen(Elm.Main, { + signInError: getParameterByName('signInError'), initialTime: new Date().getTime(), translations: document.getElementById('messages').innerHTML, - config: document.getElementById('config').innerHTML, - validateSignIn: "" + config: document.getElementById('config').innerHTML }); -app.ports.askSignIn.subscribe(function() { - navigator.id.watch({ - loggedInUser: null, - onlogin: function(assertion) { app.ports.validateSignIn.send(assertion); }, - onlogout: function() {} - }); - navigator.id.request(); -}); +function getParameterByName(name) { + name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); + var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), + results = regex.exec(location.search); + return results && decodeURIComponent(results[1].replace(/\+/g, " ")); +} |