Sha256: b935abe0f03c22b5130c9ec31fa2922cde3b45af18e31bf2cd330b92a4decf75

Contents?: true

Size: 665 Bytes

Versions: 3

Compression:

Stored size: 665 Bytes

Contents

begin
  require 'warden'
rescue
  gem 'warden'
  require 'warden'
end

# Session Serialization in. This block determines how the user will be stored
# in the session. If you're using a complex object like an ActiveRecord model,
# it is not a good idea to store the complete object. An ID is sufficient.
Warden::Manager.serialize_into_session{ |user| [user.class, user.id] }

# Session Serialization out. This block gets the user out of the session.
# It should be the reverse of serializing the object into the session
Warden::Manager.serialize_from_session do |klass, id|
  klass.find(id)
end

# Setup devise strategies for Warden
require 'devise/strategies/base'

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
devise-0.4.2 lib/devise/warden.rb
devise-0.4.1 lib/devise/warden.rb
devise-0.4.0 lib/devise/warden.rb