mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 00:51:41 +00:00
closes #14089
This commit is contained in:
parent
ef8ed271d7
commit
4a7ac981e5
1 changed files with 1 additions and 1 deletions
|
@ -55,7 +55,7 @@ module Api
|
||||||
payload = request.body.read
|
payload = request.body.read
|
||||||
site.roles.where(temporal: false, rol: 'usuarie').pluck(:token).find do |token|
|
site.roles.where(temporal: false, rol: 'usuarie').pluck(:token).find do |token|
|
||||||
new_signature = prepend + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), token, payload)
|
new_signature = prepend + OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), token, payload)
|
||||||
ActiveSupport::SecurityUtils.secure_compare(new_signature, signature)
|
ActiveSupport::SecurityUtils.secure_compare(new_signature, signature.to_s)
|
||||||
end.tap do |t|
|
end.tap do |t|
|
||||||
raise ActiveRecord::RecordNotFound, 'token no encontrado' if t.nil?
|
raise ActiveRecord::RecordNotFound, 'token no encontrado' if t.nil?
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue