what the heck was I doing here??
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
2342edccc1
commit
238e57e106
1 changed files with 2 additions and 3 deletions
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue