Sha256: b7366f7e38868def0515aa296df85b8a44f53d702242334b71ee8dc0333c3d52

Contents?: true

Size: 636 Bytes

Versions: 15

Compression:

Stored size: 636 Bytes

Contents

module Trestle
  module Auth
    class Configuration
      class Rememberable
        include Configurable

        option :enabled, true

        option :for, 2.weeks

        option :authenticate, ->(token) {
          scope = Trestle.config.auth.user_scope
          scope.authenticate_with_remember_token(token)
        }

        option :remember_me, ->(user) {
          user.remember_me!
        }

        option :forget_me, ->(user) {
          user.forget_me!
        }

        option :cookie, ->(user) {
          { value: user.remember_token, expires: user.remember_token_expires_at }
        }
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
trestle-auth-0.5.0 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.5.0.pre2 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.5.0.pre lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.4.4 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.4.3 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.4.2 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.4.1 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.4.0 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.3.0 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.2.5 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.2.4 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.2.3 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.2.2 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.2.1 lib/trestle/auth/configuration/rememberable.rb
trestle-auth-0.2.0 lib/trestle/auth/configuration/rememberable.rb