Skip to main content

valid_session

Function valid_session 

Source
pub async fn valid_session(
    pool: &SqlitePool,
    codec: &Codec,
    http: &Client,
    locks: &RefreshLocks,
    sub: &str,
    ctx: &RefreshContext<'_>,
    now: i64,
) -> Result<OAuthSession>
Expand description

Read a session, refreshing it first if it is close to expiry.

Do not wrap this in a timeout. Once the refresh request is in flight the authorization server has consumed the single-use refresh token; abandoning the future means the replacement is never stored and the session is dead. The reference carries the same warning for the same reason.