mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 14:58:27 +00:00
11 lines
367 B
Ruby
11 lines
367 B
Ruby
class ApplicationController < ActionController::API
|
|
include Pundit
|
|
before_action :authenticate_request
|
|
attr_reader :current_user
|
|
|
|
private
|
|
def authenticate_request
|
|
@current_user = AuthorizeApiRequest.call(request.headers).result
|
|
render json: { error: 'Not Authorized' }, status: 401 unless @current_user
|
|
end
|
|
end
|