Invidious is an alternative front-end to YouTube
Move captcha endpoint into Login route
matthewmcgarvey919413e2b903
diff --git a/src/invidious.cr b/src/invidious.crindex dc055e59..140a9f7b 100644--- a/src/invidious.cr+++ b/src/invidious.cr@@ -391,8 +391,6 @@ endInvidious::Routing.post "/subscription_ajax", Invidious::Routes::Subscriptions, :toggle_subscriptionInvidious::Routing.get "/subscription_manager", Invidious::Routes::Subscriptions, :subscription_manager-- Invidious::Routing.get "/Captcha", Invidious::Routes::Captcha, :get{% end %}Invidious::Routing.get "/ggpht/*", Invidious::Routes::Images, :ggphtdiff --git a/src/invidious/routes/captcha.cr b/src/invidious/routes/captcha.crdeleted file mode 100644index a1d95a4f..00000000--- a/src/invidious/routes/captcha.cr+++ /dev/null@@ -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-enddiff --git a/src/invidious/routes/login.cr b/src/invidious/routes/login.crindex 65b337d1..99fc13a2 100644--- a/src/invidious/routes/login.cr+++ b/src/invidious/routes/login.cr@@ -481,4 +481,11 @@ module Invidious::Routes::Loginenv.redirect refererend++ 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+ endenddiff --git a/src/invidious/routing.cr b/src/invidious/routing.crindex 5efe1bd8..d539d891 100644--- a/src/invidious/routing.cr+++ b/src/invidious/routing.cr@@ -15,6 +15,7 @@ macro define_user_routesInvidious::Routing.get "/login", Invidious::Routes::Login, :login_pageInvidious::Routing.post "/login", Invidious::Routes::Login, :loginInvidious::Routing.post "/signout", Invidious::Routes::Login, :signout+ Invidious::Routing.get "/Captcha", Invidious::Routes::Login, :captcha# User preferencesInvidious::Routing.get "/preferences", Invidious::Routes::PreferencesRoute, :show