Sha256: d07c8f2752c4d2237e30548322eb7de3848305f0d04d6add85ae96b5d08f5633

Contents?: true

Size: 498 Bytes

Versions: 2

Compression:

Stored size: 498 Bytes

Contents

require 'switch_user/provider/base'

module SwitchUser
  module Provider
    class Authlogic < Base
      def initialize(controller)
        @controller = controller
      end

      def login(user, scope = nil)
        UserSession.create(user)
      end

      def logout(scope = nil)
        @controller.current_user_session.destroy
      end

      def current_user(scope = nil)
        result = UserSession.find
        if result
          result.record
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
switch_user-0.9.1 lib/switch_user/provider/authlogic.rb
switch_user-0.9.0 lib/switch_user/provider/authlogic.rb