I used Chris Heald's answer here: "http://stackoverflow.com/questions/4491433/turn-omniauth-facebook-login-into-a-popup" and it worked perfectly.
The one issue is in the redirect. I am using Devise and Oauth for Facebook login - I want the popup to close after login and for the user to be redirected to the proper page after sign-in/sign-up.
For some reason, right now, the proper path is loaded in the pop-up window and the pop-up window doesn't close. I think I'm missing something very basic. Any ideas? I am a total JS newb!!
JS for Popup:
function popupCenter(url, width, height, name) {
var left = (screen.width/2)-(width/2);
var top = (screen.height/2)-(height/2);
return window.open(url, name, "menubar=no,toolbar=no,status=no,width="+width+",height="+height+",toolbar=no,left="+left+",top="+top);
}
$("a.popup").click(function(e) {
popupCenter($(this).attr("href"), $(this).attr("data-width"), $(this).attr("data-height"), "authPopup");
e.stopPropagation(); return false;
});
JS for Redirect:
if(window.opener) {
window.opener.location = <%= after_sign_in_path %>;
window.close()
}