mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-03-16.git
synced 2024-08-15 00:53:18 +00:00
Move captcha endpoint into Login route
This commit is contained in:
parent
3b1837a99b
commit
919413e2b9
4 changed files with 8 additions and 10 deletions
|
@ -391,8 +391,6 @@ end
|
||||||
|
|
||||||
Invidious::Routing.post "/subscription_ajax", Invidious::Routes::Subscriptions, :toggle_subscription
|
Invidious::Routing.post "/subscription_ajax", Invidious::Routes::Subscriptions, :toggle_subscription
|
||||||
Invidious::Routing.get "/subscription_manager", Invidious::Routes::Subscriptions, :subscription_manager
|
Invidious::Routing.get "/subscription_manager", Invidious::Routes::Subscriptions, :subscription_manager
|
||||||
|
|
||||||
Invidious::Routing.get "/Captcha", Invidious::Routes::Captcha, :get
|
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
||||||
Invidious::Routing.get "/ggpht/*", Invidious::Routes::Images, :ggpht
|
Invidious::Routing.get "/ggpht/*", Invidious::Routes::Images, :ggpht
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
module Invidious::Routes::Captcha
|
|
||||||
def self.get(env)
|
|
||||||
headers = HTTP::Headers{":authority" => "accounts.google.com"}
|
|
||||||
response = YT_POOL.client &.get(env.request.resource, headers)
|
|
||||||
env.response.headers["Content-Type"] = response.headers["Content-Type"]
|
|
||||||
response.body
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -481,4 +481,11 @@ module Invidious::Routes::Login
|
||||||
|
|
||||||
env.redirect referer
|
env.redirect referer
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.captcha(env)
|
||||||
|
headers = HTTP::Headers{":authority" => "accounts.google.com"}
|
||||||
|
response = YT_POOL.client &.get(env.request.resource, headers)
|
||||||
|
env.response.headers["Content-Type"] = response.headers["Content-Type"]
|
||||||
|
response.body
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -15,6 +15,7 @@ macro define_user_routes
|
||||||
Invidious::Routing.get "/login", Invidious::Routes::Login, :login_page
|
Invidious::Routing.get "/login", Invidious::Routes::Login, :login_page
|
||||||
Invidious::Routing.post "/login", Invidious::Routes::Login, :login
|
Invidious::Routing.post "/login", Invidious::Routes::Login, :login
|
||||||
Invidious::Routing.post "/signout", Invidious::Routes::Login, :signout
|
Invidious::Routing.post "/signout", Invidious::Routes::Login, :signout
|
||||||
|
Invidious::Routing.get "/Captcha", Invidious::Routes::Login, :captcha
|
||||||
|
|
||||||
# User preferences
|
# User preferences
|
||||||
Invidious::Routing.get "/preferences", Invidious::Routes::PreferencesRoute, :show
|
Invidious::Routing.get "/preferences", Invidious::Routes::PreferencesRoute, :show
|
||||||
|
|
Loading…
Reference in a new issue