wedding-planner/app/services/libre_captcha.rb
Manuel Bustillo be9ca9e6b0
Some checks failed
Check usage of free licenses / check-licenses (pull_request) Successful in 1m55s
Add copyright notice / copyright_notice (pull_request) Successful in 1m58s
Run unit tests / unit_tests (pull_request) Failing after 2m46s
Add copyright notice
2024-12-01 18:43:28 +00:00

14 lines
313 B
Ruby

# Copyright (C) 2024 Manuel Bustillo
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