在 devise.rb 中新增社交媒體帳戶金鑰
對於 Facebook
config.omniauth :facebook, facebook_app_id, facebook_secret_key, :display => "popup", :scope => 'email,publish_actions', info_fields: 'email,name'
對於 Twitter
config.omniauth :twitter, twitter_app_id, twitter_secret_key, :display => "popup", :scope => 'email'
對於 Linkedin
config.omniauth :linkedin, linkedin_app_id, linkedin_secret_key, :display => "popup", :scope => 'r_emailaddress,r_basicprofile'
對於 Google+
config.omniauth :gplus, gplus_app_id, gplus_secret_key, :display => "popup", scope: 'userinfo.email, userinfo.profile'
注意:當我們希望社交媒體註冊在單獨的瀏覽器視窗中開啟時,將使用
display: "popup"
屬性。