Commit fc17f5efebd8372ff4d18affb54ee0101c1c0daf
1 parent
e959e8dc
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
oauth_client: finish callback
Showing
1 changed file
with
4 additions
and
9 deletions
Show diff stats
plugins/oauth_client/views/oauth_client_plugin_public/finish.html.erb
| 1 | 1 | <script> |
| 2 | - function oauthPluginCloseLoginPopup(loggedIn, privateToken) { | |
| 3 | - if (window.opener && typeof window.opener.oauthPluginHandleLoginResult == 'function') { | |
| 4 | - try { | |
| 5 | - window.opener.oauthPluginHandleLoginResult(loggedIn, privateToken); | |
| 6 | - } catch (err) {} | |
| 7 | - window.close(); | |
| 2 | + window.addEventListener("message", function(ev) { | |
| 3 | + if (ev.data.message === "requestOauthClientPluginResult") { | |
| 4 | + ev.source.postMessage({ message: "oauthClientPluginResult", logged_in: <%= logged_in? %>, private_token: '<%= private_token %>' }, "*"); | |
| 8 | 5 | } |
| 9 | - return false; | |
| 10 | - } | |
| 11 | - oauthPluginCloseLoginPopup(<%= logged_in? %>, '<%= private_token %>'); | |
| 6 | + }); | |
| 12 | 7 | </script> | ... | ... |