mirror of
https://github.com/iv-org/invidious.git
synced 2024-12-23 05:53:37 +00:00
User: Remove broken Google login (before_all route)
This commit is contained in:
parent
d3b04ac68c
commit
836898754e
@ -80,10 +80,8 @@ module Invidious::Routes::BeforeAll
|
|||||||
raise "Cannot use token as SID"
|
raise "Cannot use token as SID"
|
||||||
end
|
end
|
||||||
|
|
||||||
# Invidious users only have SID
|
if email = Database::SessionIDs.select_email(sid)
|
||||||
if !env.request.cookies.has_key? "SSID"
|
user = Database::Users.select!(email: email)
|
||||||
if email = Invidious::Database::SessionIDs.select_email(sid)
|
|
||||||
user = Invidious::Database::Users.select!(email: email)
|
|
||||||
csrf_token = generate_response(sid, {
|
csrf_token = generate_response(sid, {
|
||||||
":authorize_token",
|
":authorize_token",
|
||||||
":playlist_ajax",
|
":playlist_ajax",
|
||||||
@ -100,30 +98,6 @@ module Invidious::Routes::BeforeAll
|
|||||||
env.set "csrf_token", csrf_token
|
env.set "csrf_token", csrf_token
|
||||||
env.set "user", user
|
env.set "user", user
|
||||||
end
|
end
|
||||||
else
|
|
||||||
headers = HTTP::Headers.new
|
|
||||||
headers["Cookie"] = env.request.headers["Cookie"]
|
|
||||||
|
|
||||||
begin
|
|
||||||
user, sid = get_user(sid, headers, false)
|
|
||||||
csrf_token = generate_response(sid, {
|
|
||||||
":authorize_token",
|
|
||||||
":playlist_ajax",
|
|
||||||
":signout",
|
|
||||||
":subscription_ajax",
|
|
||||||
":token_ajax",
|
|
||||||
":watch_ajax",
|
|
||||||
}, HMAC_KEY, 1.week)
|
|
||||||
|
|
||||||
preferences = user.preferences
|
|
||||||
env.set "preferences", preferences
|
|
||||||
|
|
||||||
env.set "sid", sid
|
|
||||||
env.set "csrf_token", csrf_token
|
|
||||||
env.set "user", user
|
|
||||||
rescue ex
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
dark_mode = convert_theme(env.params.query["dark_mode"]?) || preferences.dark_mode.to_s
|
dark_mode = convert_theme(env.params.query["dark_mode"]?) || preferences.dark_mode.to_s
|
||||||
|
Loading…
Reference in New Issue
Block a user