I receive datas from webhook and I try to get the Authorization Bearer token
that is in the headers
I tried :
data = JSON.parse(response.body)
puts "TOKEN " + data['csrf-token']['content']
Also :
if headers['Authorization'].present?
puts " HEADER " + headers['Authorization'].split(' ').last
else
puts "ERROR"
end
-> I have the ERROR
And :
data = response.body
puts "TOKEN " + data['csrf-token']['content']
-> It returns nil
Turns out that the solution was :
bearer_token = request.headers["Authorization"]
Thanks all for your help !