mirror of
https://github.com/iv-org/invidious.git
synced 2025-04-20 15:45:46 -04:00
Update authentication.cr
This commit is contained in:
parent
268d6ceae5
commit
d8abc2314e
@ -72,12 +72,15 @@ module Invidious::Routes::API::V1::Authentication
|
||||
else
|
||||
# send captcha
|
||||
captcha = Invidious::User::Captcha.generate_text(HMAC_KEY, ":register")
|
||||
# TODO Fix the formatting of tokens when it is recieved
|
||||
# from Captcha.generate_text
|
||||
# Fix token formatting
|
||||
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|
|
||||
json.object do
|
||||
json.field "question", captcha["question"]
|
||||
json.field "tokens", Array(String).from_json(captcha["tokens"])
|
||||
json.field "tokens", formatted_tokens
|
||||
end
|
||||
end
|
||||
return captcha_request
|
||||
|
Loading…
x
Reference in New Issue
Block a user