仅使用omniauth(twitter)登录Devise,Rails 3,Omniauth [英] Using only omniauth (twitter) sign-in with Devise, Rails 3, Omniauth
问题描述
我找不到任何可靠的指针如何做到这一点,和Devise路线玩耍,没有取得很好的效果。提前致谢!
从评论中复制答案,以从未回答过滤器中删除此问题:
解决这个问题的种类;讨厌的黑客,但它的作品(现在);将它添加到
我的路线:devise_for:users,:controllers => {:registrations => registration} do
get/ users / sign_up=> authentications#index
get/ users / sign_in=> 认证#索引
结束
基本上劫持了Devise表单,并将它们直接发送到
身份验证控制器,如轨道轨道I
中所述。
〜answer per cyrusd
I have a setup based on Railscasts 209, 210, 235 and 236 - Twitter sign-in is working great; however I would like to entirely remove the ability for users to create accounts local to my app. In other words, if you want to sign in, you need to use your Twitter acct. I'd just as soon not bother managing local accounts (for now - may add it back in at some point).
I can't really find any solid pointers to how to do this, and playing around with the Devise routes and such haven't yielded very good results. Thanks in advance!
Copying the answer from the comments in order to remove this question from the "Unanswered" filter:
Kind of solved this; nasty hack but it works (for now); added this to my routes:
devise_for :users, :controllers => {:registrations => "registrations"} do get "/users/sign_up" => "authentications#index" get "/users/sign_in" => "authentications#index" end
Basically hijacks the Devise forms and sends them directly to the authentications controller, as described in the Railscasts I mentioned...
~ answer per cyrusd
这篇关于仅使用omniauth(twitter)登录Devise,Rails 3,Omniauth的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!