Just run someone who stumbles on this, you don’t need to pass any parameters to your controller when using Devise / omniauth ... the following works fine
$('#fb-connect').live 'click', -> FB.login ((response) -> if response.authResponse window.location = "/users/auth/facebook/callback else console.log "User cancelled login or did not fully authorize." ), scope: "email, offline_access" false
EDIT
If you are using a smaller version or bypassing the exception that occurred when both parameters and code are missing, the following built-in js work with onclick.
<script> function fb_authorise(){ FB.login(function(response) { if(response.authResponse) { window.location = "/users/auth/facebook/callback?signed_request=<%= params[:signed_request]%>" } }, {scope: "email, offline_access"}); }; </script>
So, in response to your original question, you used the signed_request parameter, and then add the URL with the code = not signed_request
source share