Show user info on cookies page
Dependencies
- [2]
W2AVMCLOLog in with Mastodon - [3]
KDYHFAE3Add and remove cookies - [4]
LWCZDLBIAdd buttons to accept and remove cookies - [5]
2MPJPGRYPopulate cookies jar - [6]
HDHALX3UAdd Cookies Policy page - [7]
FUCFD4UVAdd log in and log out support - [8]
D3RL62X5Implement revoking delegation - [9]
WEVOADLSRequire to accept cookies policy for log in - [10]
JG2BQCRDImplement query for delegation - [*]
6NYILMKIAdd page for slow game - [*]
IXY6NZLMStart to use migrations files for PostgreSQL database
Change contents
- replacement in src/pages/slow_game.rs at line 665
log::error!("Pool RW execute insert error {}", e);log::error!("Pool RW execute insert query delegation error: {}", e); - replacement in src/pages/log_in.rs at line 41
if !jarif jar - replacement in src/pages/log_in.rs at line 44
.map_or(false, |x| x.value() == "yes").is_none_or(|x| x.value() != "yes") - replacement in src/pages/log_in.rs at line 69
if !jar// ToDo: skip this check if player accepted themif jar - replacement in src/pages/log_in.rs at line 73
.map_or(false, |x| x.value() == "yes").is_none_or(|x| x.value() != "yes") - replacement in src/pages/cookies_policy.rs at line 5
use crate::pages::{insert_security_headers, request_to_jar};use crate::pages::{insert_security_headers, request_to_jar, CommonAuthInfo}; - replacement in src/pages/cookies_policy.rs at line 9
struct CookieInfo {i_accept_cookie: bool,struct CookieInfo<'a> {pub common_auth_info: CommonAuthInfo<'a>,pub i_accept_cookie: bool, - edit in src/pages/cookies_policy.rs at line 16
let user = jar.private(&data.cookies_key).get("auth").map(|x| x.value().to_string()); - edit in src/pages/cookies_policy.rs at line 25
common_auth_info: CommonAuthInfo {user: user.map(Into::into),}, - replacement in src/pages/cookies_policy.rs at line 31
.map_or(false, |x| x.value() == "yes"),.is_some_and(|x| x.value() == "yes"), - file addition: 20240731_1_users_accepted_cookies.sql[13.15]
-- Create field to store if player accepted cookiesDO $$BEGINIF NOT EXISTS (SELECT 1 FROM pg_class cINNER JOIN pg_namespace n ON n.oid = c.relnamespaceINNER JOIN pg_attribute a ON a.attrelid = c.oidWHERE c.relname = 'users' AND n.nspname = 'auth' AND a.attname = 'accept_cookies') THENALTER TABLE auth.users ADD COLUMN accept_cookies BOOLEAN NULL;END IF;END$$;