/// Validates the token only if it is supplied
Validates the token only if it is supplied
Validates the token only if it is supplied
pub fn optional_valid_token(token: &Option<String>) -> Result<Option<ObjectId>, GaneshaError> {
    if let Some(token) = token {
        Ok(Some(validate_token(token)?))
    } else {
        Ok(None)
    }
}
pub fn optional_valid_token ( token : & Option < String > ) -> Result < Option < ObjectId > , GaneshaError > { if let Some ( token ) = token { Ok ( Some ( validate_token ( token ) ? ) ) } else { Ok ( None ) } }
Validates the token only if it is supplied
Validates the token only if it is supplied
token
&Option<String>