Class: CanvasShim::ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/canvas_shim/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#validate_keyObject



5
6
7
8
9
10
# File 'app/controllers/canvas_shim/application_controller.rb', line 5

def validate_key
  token = SettingsService::AuthToken.authenticate(
    request.headers['HTTP_AUTHORIZATION'].try(:gsub, 'Bearer ', '')
  )
  render(json: {status: 'error'}, status: 401) and return unless token
end