lacoctelera::authentication

Function check_access

Source
pub async fn check_access(
    pool: &MySqlPool,
    token: &SecretString,
) -> Result<(), Box<dyn Error>>
Expand description

Check if the client hash access to the restricted API’s endpoints.

§Description

Given a client access token, the stored hash of the token is retrieved from the database and compared. If the comparison is positive, it is checked if the client is enabled.