From 731e2fd9477e925a485af70a1aa1e48d7e2c8996 Mon Sep 17 00:00:00 2001 From: Adam Snaider Date: Fri, 20 May 2022 13:02:09 -0700 Subject: [PATCH] Fixed merge conflicts. --- Cargo.lock | 12 ++++++------ src/controllers/user/session.rs | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fbca48d4f99..642859cf75c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ "hyper", "hyper-tls", "indexmap", - "ipnetwork", + "ipnetwork 0.19.0", "lazy_static", "lettre", "minijinja", @@ -771,7 +771,7 @@ dependencies = [ "byteorder", "chrono", "diesel_derives", - "ipnetwork", + "ipnetwork 0.18.0", "libc", "pq-sys", "r2d2", @@ -1352,18 +1352,18 @@ checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "ipnetwork" -version = "0.19.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f84f1612606f3753f205a4e9a2efd6fe5b4c573a6269b2cc6c3003d44a0d127" +checksum = "4088d739b183546b239688ddbc79891831df421773df95e236daf7867866d355" dependencies = [ "serde", ] [[package]] name = "ipnetwork" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4088d739b183546b239688ddbc79891831df421773df95e236daf7867866d355" +checksum = "1f84f1612606f3753f205a4e9a2efd6fe5b4c573a6269b2cc6c3003d44a0d127" dependencies = [ "serde", ] diff --git a/src/controllers/user/session.rs b/src/controllers/user/session.rs index 5928cf418ac..a4acd9d0fa7 100644 --- a/src/controllers/user/session.rs +++ b/src/controllers/user/session.rs @@ -108,7 +108,7 @@ pub fn authorize(req: &mut dyn RequestExt) -> EndpointResult { )?; // Setup a persistent session for the newly logged in user. - let (_session, cookie) = PersistentSession::create(user.id).insert(&*req.db_conn()?)?; + let (_session, cookie) = PersistentSession::create(user.id).insert(&*req.db_write()?)?; // Setup persistent session cookie. let secure = req.app().config.env() == Env::Production; @@ -178,7 +178,7 @@ pub fn logout(req: &mut dyn RequestExt) -> EndpointResult { req.cookies_mut() .remove(Cookie::named(SessionCookie::SESSION_COOKIE_NAME)); - let conn = req.db_conn()?; + let conn = req.db_write()?; let mut session = PersistentSession::find(session_cookie.session_id(), &conn)? .ok_or(LogoutError::SessionNotInDB)?; session.revoke().update(&conn)?;