mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-22 21:28:01 -05:00
Sanity check the serialized class.
This commit is contained in:
@@ -93,6 +93,7 @@ module Devise
|
||||
# Hook to serialize user from session. Overwrite if you want.
|
||||
def serialize_from_session(keys)
|
||||
klass, id = keys
|
||||
raise "#{self} cannot serialize from #{klass} session since it's not its ancestors" unless klass <= self
|
||||
klass.find_by_id(id)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user