Skip to content

Commit

Permalink
Fixed merge conflicts.
Browse files Browse the repository at this point in the history
  • Loading branch information
adsnaider committed May 20, 2022
1 parent 26aeb88 commit 731e2fd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/controllers/user/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)?;
Expand Down

0 comments on commit 731e2fd

Please sign in to comment.