Sha256: a7eddaa48e02b363ed650404b32becc1f902c27611eaf295da926de255e4ad2c

Contents?: true

Size: 649 Bytes

Versions: 1

Compression:

Stored size: 649 Bytes

Contents

module SimpleTokenAuthentication
  class SignInHandler
    include Singleton

    # Devise sign in is performed through a controller
    # which includes Devise::Controllers::SignInOut
    def sign_in(controller, record, *args)
      integrate_with_devise_trackable!(controller)

      controller.send(:sign_in, record, *args)
    end

    private

    def integrate_with_devise_trackable!(controller)
      # Sign in using token should not be tracked by Devise trackable
      # See https://github.com/plataformatec/devise/issues/953
      controller.env["devise.skip_trackable"] = SimpleTokenAuthentication.skip_devise_trackable
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_token_authentication-1.13.0 lib/simple_token_authentication/sign_in_handler.rb