var app = Elm.fullscreen(Elm.Main, { initialTime: new Date().getTime(), translations: document.getElementById('messages').innerHTML, config: document.getElementById('config').innerHTML, sign: null }); navigator.id.watch({ loggedInUser: null, onlogin: function(assertion) { app.ports.sign.send({ operation: 'SignIn', assertion: assertion }); }, onlogout: function() {} }); app.ports.persona.subscribe(function(communication) { if(communication === 'SignIn') { navigator.id.request(); } else if(communication === 'SignOut') { navigator.id.logout(); app.ports.sign.send({ operation: 'SignOut' }); } });