wedding-planner/app/services/libre_captcha.rb
Manuel Bustillo b237239a1f
Some checks failed
Check usage of free licenses / check-licenses (pull_request) Failing after 48s
Add copyright notice / copyright_notice (pull_request) Successful in 57s
Run unit tests / unit_tests (pull_request) Failing after 3m28s
Define an endpoint to retrieve a LibreCaptcha captcha
2024-12-01 19:42:25 +01:00

12 lines
275 B
Ruby

class LibreCaptcha
def get_id
HTTParty.post("http://libre-captcha:8888/v2/captcha",
body: {
input_type: "text",
level: :hard,
media: 'image/png',
size: '350x100'
}.to_json
).then { |raw| JSON.parse(raw)['id'] }
end
end