1
0
Fork 0
forked from OpenNeo/impress
impress/lib/openneo-auth/strategy.rb
2010-10-18 17:58:45 -04:00

18 lines
376 B
Ruby

require 'warden'
module Openneo
module Auth
class Strategy < Warden::Strategies::Base
def authenticate!
begin
auth_session = Session.find session[:session_id]
rescue Session::NotFound => e
fail! e.message
else
auth_session.destroy!
success! auth_session.user
end
end
end
end
end