ここでChris Healdの答えを使用しました:「http://stackoverflow.com/questions/4491433/turn-omniauth-facebook-login-into-a-popup」で、完全に機能しました。
1 つの問題はリダイレクトにあります。Facebook ログインに Devise と Oauth を使用しています。ログイン後にポップアップを閉じ、サインイン/サインアップ後にユーザーが適切なページにリダイレクトされるようにします。
何らかの理由で、現在、適切なパスがポップアップ ウィンドウに読み込まれ、ポップアップ ウィンドウが閉じません。私は非常に基本的な何かが欠けていると思います。何か案は?私は全くのJS初心者です!!
ポップアップの JS:
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:
if(window.opener) {
window.opener.location = <%= after_sign_in_path %>;
window.close()
}