Class: Grape::Knock::Authenticable

Inherits:
Middleware::Base
  • Object
show all
Includes:
Knock::Authenticable
Defined in:
lib/grape/knock/authenticable.rb

Instance Method Summary collapse

Instance Method Details

#beforeObject



15
16
17
18
19
# File 'lib/grape/knock/authenticable.rb', line 15

def before
  authenticate
  context.extend Grape::Knock::Methods
  context.current_user = @current_user
end

#contextObject



11
12
13
# File 'lib/grape/knock/authenticable.rb', line 11

def context
  env['api.endpoint']
end