mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-28 23:48:31 +00:00
Update authentication.cr
This commit is contained in:
parent
268d6ceae5
commit
d8abc2314e
@ -72,12 +72,15 @@ module Invidious::Routes::API::V1::Authentication
|
|||||||
else
|
else
|
||||||
# send captcha
|
# send captcha
|
||||||
captcha = Invidious::User::Captcha.generate_text(HMAC_KEY, ":register")
|
captcha = Invidious::User::Captcha.generate_text(HMAC_KEY, ":register")
|
||||||
# TODO Fix the formatting of tokens when it is recieved
|
# Fix token formatting
|
||||||
# from Captcha.generate_text
|
formatted_tokens : Array(JSON::Any) = Array(JSON::Any).new
|
||||||
|
captcha["tokens"].each do |tok|
|
||||||
|
formatted_tokens << JSON.Parse(tok)
|
||||||
|
end
|
||||||
captcha_request = JSON.build do |json|
|
captcha_request = JSON.build do |json|
|
||||||
json.object do
|
json.object do
|
||||||
json.field "question", captcha["question"]
|
json.field "question", captcha["question"]
|
||||||
json.field "tokens", Array(String).from_json(captcha["tokens"])
|
json.field "tokens", formatted_tokens
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return captcha_request
|
return captcha_request
|
||||||
|
Loading…
Reference in New Issue
Block a user