diff --git a/src/invidious/routes/api/v1/authentication.cr b/src/invidious/routes/api/v1/authentication.cr index b0cb9e00..2a0e4e58 100644 --- a/src/invidious/routes/api/v1/authentication.cr +++ b/src/invidious/routes/api/v1/authentication.cr @@ -36,7 +36,7 @@ module Invidious::Routes::API::V1::Authentication # send captcha if enabled if CONFIG.captcha_enabled # send captcha - captcha = Invidious::User::Captcha.generate_text(HMAC_KEY) + captcha = Invidious::User::Captcha.generate_text(HMAC_KEY, ":captcha") # puts captcha response = JSON.build do |json| json.object do diff --git a/src/invidious/user/captcha.cr b/src/invidious/user/captcha.cr index 8a0f67e5..b1f5c5d6 100644 --- a/src/invidious/user/captcha.cr +++ b/src/invidious/user/captcha.cr @@ -61,12 +61,12 @@ struct Invidious::User } end - def generate_text(key) + def generate_text(key, scope = ":login") response = make_client(TEXTCAPTCHA_URL, &.get("/github.com/iv.org/invidious.json").body) response = JSON.parse(response) tokens = response["a"].as_a.map do |answer| - generate_response(answer.as_s, {":login"}, key, use_nonce: true) + generate_response(answer.as_s, {scope}, key, use_nonce: true) end return {