use postmessage for development communication

This commit is contained in:
2015-09-05 19:37:38 +02:00
parent e2e883df1d
commit c55740be0a
+3 -9
View File
@@ -2,16 +2,10 @@
<html> <html>
<head> <head>
<script> <script>
if(window.parent && window.opener.App && window.opener.App.__container__){ console.log("closing window");
window.opener.App.__container__.lookup('route:application').handleAuthInfo('<%= params[:user_id] %>', '<%= params[:authentication_token] %>'); window.opener.postMessage({user_id: '<%= params[:user_id] %>', authentication_token: '<%= params[:authentication_token] %>'}, "http://localhost:4200");
window.close(); 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> </head>
<body></body> <body>Closing window...</body>
</html> </html>