Sha256: 9c670d31f47e2a7d71437b2ee0db3f200e1121b1ac472d43bad4e762d7849440
Contents?: true
Size: 780 Bytes
Versions: 15
Compression:
Stored size: 780 Bytes
Contents
module Devise module Strategies # Base strategy for Devise. Responsible for verifying correct scope and # mapping. class Base < Warden::Strategies::Base # Validate strategy. By default will raise an error if no scope or an # invalid mapping is found. def valid? mapping.for.include?(self.class.name.split("::").last.underscore.to_sym) end # Checks if a valid scope was given for devise and find mapping based on # this scope. def mapping @mapping ||= begin raise "You need to give a scope for Devise authentication" unless scope raise "You need to give a valid Devise mapping" unless mapping = Devise.mappings[scope] mapping end end end end end
Version data entries
15 entries across 15 versions & 3 rubygems