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 | 22 | if session.delete(:oauth_client_popup) || params[:oauth_client_popup] |
| 23 | 23 | current_user.private_token_expired? if current_user.present? |
| 24 | 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 | 26 | else |
| 27 | 27 | redirect_to :controller => :home |
| 28 | 28 | end | ... | ... |
plugins/oauth_client/views/oauth_client_plugin_public/finish.html.erb
| 1 | 1 | <script> |
| 2 | 2 | window.addEventListener("message", function(ev) { |
| 3 | 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 | 7 | </script> | ... | ... |