mirror of
https://github.com/iv-org/invidious.git
synced 2025-08-09 20:24:03 +00:00
Fix to_json for storing user preferences
This commit is contained in:
@@ -956,7 +956,7 @@ post "/login" do |env|
|
|||||||
|
|
||||||
if env.request.cookies["PREFS"]?
|
if env.request.cookies["PREFS"]?
|
||||||
preferences = env.get("preferences").as(Preferences)
|
preferences = env.get("preferences").as(Preferences)
|
||||||
PG_DB.exec("UPDATE users SET preferences = $1 WHERE email = $2", preferences, user.email)
|
PG_DB.exec("UPDATE users SET preferences = $1 WHERE email = $2", preferences.to_json, user.email)
|
||||||
|
|
||||||
cookie = env.request.cookies["PREFS"]
|
cookie = env.request.cookies["PREFS"]
|
||||||
cookie.expires = Time.new(1990, 1, 1)
|
cookie.expires = Time.new(1990, 1, 1)
|
||||||
@@ -1129,8 +1129,8 @@ post "/login" do |env|
|
|||||||
end
|
end
|
||||||
|
|
||||||
if env.request.cookies["PREFS"]?
|
if env.request.cookies["PREFS"]?
|
||||||
preferences = env.get("preferences").as(Preferences).to_json
|
preferences = env.get("preferences").as(Preferences)
|
||||||
PG_DB.exec("UPDATE users SET preferences = $1 WHERE email = $2", preferences, user.email)
|
PG_DB.exec("UPDATE users SET preferences = $1 WHERE email = $2", preferences.to_json, user.email)
|
||||||
|
|
||||||
cookie = env.request.cookies["PREFS"]
|
cookie = env.request.cookies["PREFS"]
|
||||||
cookie.expires = Time.new(1990, 1, 1)
|
cookie.expires = Time.new(1990, 1, 1)
|
||||||
|
Reference in New Issue
Block a user