You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
765 B
24 lines
765 B
// pub async fn validator(
|
|
// req: ServiceRequest,
|
|
// credentials: BasicAuth,
|
|
// ) -> Result<ServiceRequest, Error> {
|
|
// println!("{}", credentials.user_id());
|
|
// println!("{:?}", credentials.password());
|
|
// // verify credentials from db
|
|
// let config = req.app_data::<AppConfig>().expect("Error getting config");
|
|
|
|
// let valid =
|
|
// web::block(move || validate_basic_auth(credentials, config)).await?;
|
|
// if valid {
|
|
// debug!("Success");
|
|
// Ok(req)
|
|
// } else {
|
|
// println!("blah");
|
|
// let err: Error = crate::errors::DomainError::new_password_error(
|
|
// "Wrong password or account does not exist".to_string(),
|
|
// )
|
|
// .into();
|
|
|
|
// Err(err)
|
|
// }
|
|
// }
|