Sha256: 3ba5d29e615f4cad204faaed8931195ef7257655c4e757a897c70095dd9801d2

Contents?: true

Size: 789 Bytes

Versions: 8

Compression:

Stored size: 789 Bytes

Contents

module Trestle
  module Auth
    module Backends
      class Base
        attr_reader :controller, :request, :session, :cookies

        def initialize(controller:, request:, session:, cookies:)
          @controller, @request, @session, @cookies = controller, request, session, cookies
        end

        # Default params scope to use for the login form.
        def scope
          :user
        end

        # Stores the previous return location in the session to return to after logging in.
        def store_location(url)
          session[:trestle_return_to] = url
        end

        # Returns (and deletes) the previously stored return location from the session.
        def previous_location
          session.delete(:trestle_return_to)
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
trestle-auth-0.5.0 lib/trestle/auth/backends/base.rb
trestle-auth-0.5.0.pre2 lib/trestle/auth/backends/base.rb
trestle-auth-0.5.0.pre lib/trestle/auth/backends/base.rb
trestle-auth-0.4.4 lib/trestle/auth/backends/base.rb
trestle-auth-0.4.3 lib/trestle/auth/backends/base.rb
trestle-auth-0.4.2 lib/trestle/auth/backends/base.rb
trestle-auth-0.4.1 lib/trestle/auth/backends/base.rb
trestle-auth-0.4.0 lib/trestle/auth/backends/base.rb