pub async fn logout(user_agent: &str, refresh_token: &str) -> Result<(), Error> {
    let refresh_token = valid_refresh_token_from_str(user_agent, refresh_token).await?;

    if STORAGE.get_user(&refresh_token.email).await.is_none() {
        println!("valid token for non-existent email {:?}", refresh_token);
        return Err(remove_bad_refresh_token(&refresh_token).await);
    };

    STORAGE.remove_refresh_token(&refresh_token).await
}
/// Revokes the refresh token provided. This is done regardless of the validations, because if the
/// validations fail then the token **should** be revoked anyway.
Revokes the refresh token provided. This is done regardless of the validations, because if the
validations fail then the token **should** be revoked anyway.
Revokes the refresh token provided . This is done regardless of the validations because if the validations fail then the token ** should ** be revoked anyway .
pub async fn logout(user_agent: &str, refresh_token: &str) -> Result<(), Error> {
    let refresh_token = valid_refresh_token_from_str(user_agent, refresh_token).await?;
    if STORAGE.get_user(&refresh_token.email).await.is_none() {
        println!("valid token for non-existent email {:?}", refresh_token);
        return Err(remove_bad_refresh_token(&refresh_token).await);
    };
    STORAGE.remove_refresh_token(&refresh_token).await
}
pub async fn logout ( user_agent : & str , refresh_token : & str ) -> Result < ( ) , Error > { let refresh_token = valid_refresh_token_from_str ( user_agent , refresh_token ) . await ? ; if STORAGE . get_user ( & refresh_token . email ) . await . is_none ( ) { println ! ( " " refresh_token ) ; return Err ( remove_bad_refresh_token ( & refresh_token ) . await ) ; } ; STORAGE . remove_refresh_token ( & refresh_token ) . await }
Revokes the refresh token provided.
Revokes the refresh token provided .
user_agent
&str
refresh_token
&str
user_agent
&str
refresh_token
&str