Commit c857b114bf5a309ded83d97e168a00319b97642f
1 parent
dc939427
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
oauth_client: fix login with popup
Showing
2 changed files
with
2 additions
and
2 deletions
Show diff stats
plugins/oauth_client/controllers/public/oauth_client_plugin_public_controller.rb
| @@ -22,7 +22,7 @@ class OauthClientPluginPublicController < PublicController | @@ -22,7 +22,7 @@ class OauthClientPluginPublicController < PublicController | ||
| 22 | if session.delete(:oauth_client_popup) || params[:oauth_client_popup] | 22 | if session.delete(:oauth_client_popup) || params[:oauth_client_popup] |
| 23 | current_user.private_token_expired? if current_user.present? | 23 | current_user.private_token_expired? if current_user.present? |
| 24 | private_token = current_user.present? ? current_user.private_token : '' | 24 | private_token = current_user.present? ? current_user.private_token : '' |
| 25 | - render 'oauth_client_plugin_public/finish', :locals => {:private_token => private_token, :user => params[:user]}, :layout => false | 25 | + render 'oauth_client_plugin_public/finish', :locals => {:private_token => private_token, :user => current_user}, :layout => false |
| 26 | else | 26 | else |
| 27 | redirect_to :controller => :home | 27 | redirect_to :controller => :home |
| 28 | end | 28 | end |
plugins/oauth_client/views/oauth_client_plugin_public/finish.html.erb
| 1 | <script> | 1 | <script> |
| 2 | window.addEventListener("message", function(ev) { | 2 | window.addEventListener("message", function(ev) { |
| 3 | if (ev.data.message === "requestOauthClientPluginResult") { | 3 | if (ev.data.message === "requestOauthClientPluginResult") { |
| 4 | - ev.source.postMessage({ message: "oauthClientPluginResult", logged_in: <%= logged_in? %>, private_token: '<%= private_token %>', user: <%= user.to_json %> }, "*"); | 4 | + ev.source.postMessage({ message: "oauthClientPluginResult", logged_in: <%= logged_in? %>, private_token: '<%= private_token %>', user: <%= current_user.to_json %> }, "*"); |
| 5 | } | 5 | } |
| 6 | }); | 6 | }); |
| 7 | </script> | 7 | </script> |