Sha256: c57dcff318cb21e5cd73e57a87c1e1a1b98c043807409ea95a9f896b97a127cb

Contents?: true

Size: 454 Bytes

Versions: 4

Compression:

Stored size: 454 Bytes

Contents

# frozen_string_literal: true

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

      def login(user, _scope = nil)
        @controller.current_user = user
      end

      def logout(_scope = nil)
        @controller.logout_killing_session!
      end

      def current_user(_scope = nil)
        @controller.current_user
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
switch_user-1.5.4 lib/switch_user/provider/restful_authentication.rb
switch_user-1.5.3 lib/switch_user/provider/restful_authentication.rb
switch_user-1.5.2 lib/switch_user/provider/restful_authentication.rb
switch_user-1.5.1 lib/switch_user/provider/restful_authentication.rb