1
0
Fork 0
forked from OpenNeo/impress

make openneo auth strategy a devise strategy, so it can inherit rememberable

This commit is contained in:
Emi Matchu 2011-02-05 10:33:34 -05:00
parent 8c8776ff63
commit b07456cc30

View file

@ -1,9 +1,9 @@
require 'warden'
require 'devise'
module Openneo
module Auth
module Strategies
class Token < Warden::Strategies::Base
class Token < Devise::Strategies::Authenticatable
def valid?
session && session[:session_id]
end
@ -12,13 +12,16 @@ module Openneo
begin
auth_session = Session.find session[:session_id]
rescue Session::NotFound => e
fail! e.message
pass
else
auth_session.destroy!
auth_session.user.remember_me!
success! auth_session.user
end
end
def remember_me?
true
end
end
end
end