Function invalidate_session

Source
pub async fn invalidate_session(
    pool: &Pool<MySql>,
    session_token: &str,
) -> Result<()>
Expand description

Invalidates a user session.

This function marks a session as inactive, effectively logging the user out.

§Arguments

  • pool - Database connection pool for executing the query
  • session_token - The session token to invalidate

§Returns

  • Ok(()) - Successfully invalidated the session
  • Err(anyhow::Error) - Failed to invalidate the session