what the heck was I doing here??
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Hamcha 2023-07-21 17:25:24 +02:00
parent 2342edccc1
commit 238e57e106
Signed by: hamcha
GPG Key ID: 1669C533B8CF6D89
1 changed files with 2 additions and 3 deletions

View File

@ -95,13 +95,12 @@ pub async fn refresh_sessions<B>(
{
let database = Database::from(&state);
if let Ok(Some((session, user))) = database.find_session(session_id).await {
// session validity requirements: secret must match, session must not have been expired
// session validity requirements: secret must match, session must not have expired
if session.secret == session_secret && session.expires_at >= Utc::now().naive_utc() {
// in the future we might wanna change the session secret, if we do, do it here!
if let Ok((session, user)) = database
if let Ok(session) = database
.refresh_session(session, Duration::seconds(state.config.session_duration))
.await
.map(|s| (s, user))
{
let extensions = req.extensions_mut();
extensions.insert(session.clone());