1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/devise/strategies/base.rb
2010-03-31 21:43:19 +02:00

19 lines
No EOL
528 B
Ruby

module Devise
module Strategies
# Base strategy for Devise. Responsible for verifying correct scope and mapping.
class Base < ::Warden::Strategies::Base
# Checks if a valid scope was given for devise and find mapping based on this scope.
def mapping
@mapping ||= begin
mapping = Devise.mappings[scope]
raise "Could not find mapping for #{scope}" unless mapping
mapping
end
end
def succeeded?
@result == :success
end
end
end
end