diff options
author | Joris | 2016-03-11 23:21:06 +0100 |
---|---|---|
committer | Joris | 2016-03-11 23:21:06 +0100 |
commit | 9d57e149fcb124a28813c56f83cf254eb92baa42 (patch) | |
tree | b796c4fdc738006c07e65e01f4845adafe064d2a /src/client/js | |
parent | 709d1cf587e92508ef73bca8e847cfa510c03069 (diff) |
Don't use persona anymore, use email token to sign in
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, " ")); +} |