demarches-normaliennes/app/controllers/api/v2/base_controller.rb

21 lines
413 B
Ruby
Raw Normal View History

2018-11-19 21:18:17 +01:00
class API::V2::BaseController < ApplicationController
protect_from_forgery with: :null_session
private
def context
{
administrateur_id: current_administrateur&.id,
token: authorization_bearer_token
}
end
def authorization_bearer_token
received_token = nil
authenticate_with_http_token do |token, _options|
received_token = token
end
received_token
end
end