clean: log current_user in api v1

This commit is contained in:
simon lehericey 2023-03-15 17:53:45 +01:00
parent c0ca9f156e
commit 7a6658700e
2 changed files with 15 additions and 8 deletions

View file

@ -13,8 +13,11 @@ class API::V1::ProceduresController < APIController
administrateur = find_administrateur_for_token(@procedure)
if administrateur.nil?
render json: {}, status: :unauthorized
else
# allow BaseController append_info_to_payload
# to log info on current_user
@current_user = administrateur.user
end
rescue ActiveRecord::RecordNotFound
render json: {}, status: :not_found
end