use postmessage for development communication

This commit is contained in:
2015-09-05 19:37:38 +02:00
parent e2e883df1d
commit c55740be0a
+5 -11
View File
@@ -1,17 +1,11 @@
<!doctype html>
<html>
<head>
<script>
if(window.parent && window.opener.App && window.opener.App.__container__){
window.opener.App.__container__.lookup('route:application').handleAuthInfo('<%= params[:user_id] %>', '<%= params[:authentication_token] %>');
<script>
console.log("closing window");
window.opener.postMessage({user_id: '<%= params[:user_id] %>', authentication_token: '<%= params[:authentication_token] %>'}, "http://localhost:4200");
window.close();
}else{
localStorage.setItem('auth_token', '<%= params[:authentication_token] %>');
localStorage.setItem('user_id', '<%= params[:user_id] %>');
window.close();
setTimeout(function(){alert('Something went wrong. Please restart the application and warnd the Mozo crew it the proplem persists')}, 5000);
}
</script>
</script>
</head>
<body></body>
<body>Closing window...</body>
</html>