mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-28 15:38:30 +00:00
Update authentication.cr
This commit is contained in:
parent
550140627d
commit
b66a15e890
@ -43,14 +43,14 @@ module Invidious::Routes::API::V1::Authentication
|
|||||||
# check if user is responding to captcha
|
# check if user is responding to captcha
|
||||||
if captcha_response
|
if captcha_response
|
||||||
# process captcha response
|
# process captcha response
|
||||||
# answer = captcha_response.answer
|
answer = captcha_response.answer
|
||||||
# answer = answer.lstrip('0')
|
answer = answer.lstrip('0')
|
||||||
# answer = OpenSSL::HMAC.hexdigest(:sha256, HMAC_KEY, answer)
|
answer = OpenSSL::HMAC.hexdigest(:sha256, HMAC_KEY, answer)
|
||||||
# begin
|
begin
|
||||||
# validate_request(, answer, env.request, HMAC_KEY, locale)
|
validate_request(captcha_response.tokens[0], answer, env.request, HMAC_KEY, locale)
|
||||||
# rescue ex
|
rescue ex
|
||||||
# return error_jsonror(400, ex)
|
return error_jsonror(400, ex)
|
||||||
# end
|
end
|
||||||
else
|
else
|
||||||
# send captcha
|
# send captcha
|
||||||
captcha = Invidious::User::Captcha.generate_text(HMAC_KEY)
|
captcha = Invidious::User::Captcha.generate_text(HMAC_KEY)
|
||||||
@ -144,7 +144,7 @@ struct CaptchaResponse
|
|||||||
property username : String
|
property username : String
|
||||||
property password : String
|
property password : String
|
||||||
property answer : String
|
property answer : String
|
||||||
# property tokens : Array()
|
property tokens : Array(String)
|
||||||
end
|
end
|
||||||
|
|
||||||
struct Credentials
|
struct Credentials
|
||||||
|
Loading…
Reference in New Issue
Block a user