3

I am attempting to write my own Devise authentication module following the procedure outlined in http://4trabes.com/2012/10/31/remote-authentication-with-devise/

I've created a User class under app/models and Devise::Models and Devise::Strategies modules under lib. I've also added:

require 'remote_authenticatable'  

config.warden do |manager|
   manager.strategies.add(:remote, Devise::Strategies::RemoteAuthenticatable)
   manager.default_strategies(:scope => :user).unshift :remote
end

to my initializers/devise.rb file.

And I've added:

devise_for :users

to my routes.rb

However, for some reason the sign_on and sign_off routes do not appear in my rake routes.

Is there some good documentation on how the Devise plugin works with these kinds of extensions?

Peter.

4

2 回答 2

2

好的,我想通了。

我需要添加

Devise.add_module :remote_authenticatable, :controller => :sessions,  :route => { :session => :routes }

到我的配置/初始化程序/设计文件。谁能解释这条线的作用?特别关注最后两个参数?

于 2013-02-14T17:37:28.547 回答
-1

默认情况下调用它sign_in并且sign_out:)

于 2013-02-14T17:30:14.680 回答