Use http authorization to place api key
This commit is contained in:
parent
d44a7ab563
commit
1fba3b98be
1 changed files with 3 additions and 2 deletions
|
@ -15,8 +15,9 @@ class ApplicationController < ActionController::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_client
|
def current_client
|
||||||
Client.find_by key: request.headers.inspect.to_s
|
@current_client ||= authenticate_with_http_token do |token, options|
|
||||||
@current_client ||= Client.find_by key: (request.headers["X_API_KEY"] || request.headers["HTTP_X_API_KEY"])
|
Client.find_by key: token
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def current_ability
|
def current_ability
|
||||||
|
|
Loading…
Reference in a new issue