Commit eff12aea9c2050f0acdcda89b10460582485be85
1 parent
fc17f5ef
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Revert "oauth_client: finish callback"
This reverts commit fc17f5efebd8372ff4d18affb54ee0101c1c0daf.
Showing
1 changed file
with
9 additions
and
4 deletions
Show diff stats
plugins/oauth_client/views/oauth_client_plugin_public/finish.html.erb
| 1 | 1 | <script> |
| 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 %>' }, "*"); | |
| 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(); | |
| 5 | 8 | } |
| 6 | - }); | |
| 9 | + return false; | |
| 10 | + } | |
| 11 | + oauthPluginCloseLoginPopup(<%= logged_in? %>, '<%= private_token %>'); | |
| 7 | 12 | </script> | ... | ... |