Skip to main content

authenticate

Function authenticate 

Source
pub async fn authenticate(
    pool: &PgPool,
    token: &str,
) -> Result<Option<SessionUser>>
Expand description

Resolves a token to its user, refusing expired sessions and inactive people.

The expiry is checked in the query rather than in Rust: a row that outlived its welcome must not authenticate anyone even if the sweep that deletes it has not run.