Sha256: 399f46c0ae42fcc0f408f904ee1a353b6b13967509abbdc9a9e9387825d51d3b

Contents?: true

Size: 333 Bytes

Versions: 6

Compression:

Stored size: 333 Bytes

Contents

class TokenStrategy < Warden::Strategies::Base
  def store?; false end
  def valid?
    env['HTTP_X_AUTHORIZE']
  end
  def access_token_type
    :public
  end
  def authenticate!
    user = Models::User.find_by(token: env['HTTP_X_AUTHORIZE'])

    if user.nil?
      fail!(:no_access)
    else
      success!(user)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
grape-gen-0.0.6 template/lib/warden/token_strategy.rb
grape-gen-0.0.5 template/lib/warden/token_strategy.rb
grape-gen-0.0.4 template/lib/warden/token_strategy.rb
grape-gen-0.0.3 template/lib/warden/token_strategy.rb
grape-gen-0.0.2 template/lib/warden/token_strategy.rb
grape-gen-0.0.1 template/lib/warden/token_strategy.rb