From 268d6ceae5e78a05773374852a43bf5aeadf2eeb Mon Sep 17 00:00:00 2001 From: Ryan G <78384369+SpongeManiac@users.noreply.github.com> Date: Tue, 13 Jun 2023 11:52:45 -0700 Subject: [PATCH] Update authentication.cr --- src/invidious/routes/api/v1/authentication.cr | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/invidious/routes/api/v1/authentication.cr b/src/invidious/routes/api/v1/authentication.cr index e452475c..696b2f99 100644 --- a/src/invidious/routes/api/v1/authentication.cr +++ b/src/invidious/routes/api/v1/authentication.cr @@ -58,6 +58,7 @@ module Invidious::Routes::API::V1::Authentication error_exception = Exception.new tokens.each do |tok| begin + # TO-DO fix formatting of tokens when recieved from Captcha.generate_text validate_request(tok, answer, env.request, HMAC_KEY, locale) found_valid_captcha = true rescue ex @@ -71,11 +72,12 @@ module Invidious::Routes::API::V1::Authentication else # send captcha captcha = Invidious::User::Captcha.generate_text(HMAC_KEY, ":register") - # puts captcha + # TODO Fix the formatting of tokens when it is recieved + # from Captcha.generate_text captcha_request = JSON.build do |json| json.object do json.field "question", captcha["question"] - json.field "tokens", captcha["tokens"] + json.field "tokens", Array(String).from_json(captcha["tokens"]) end end return captcha_request