(hash: &str, password: &str)
| 20 | } |
| 21 | |
| 22 | pub fn verify(hash: &str, password: &str) -> Result<bool, ServiceError> { |
| 23 | argon2::verify_encoded_ext(hash, password.as_bytes(), SECRET_KEY.as_bytes(), &[]).map_err( |
| 24 | |err| { |
| 25 | dbg!(err); |
| 26 | ServiceError::Unauthorized |
| 27 | }, |
| 28 | ) |
| 29 | } |
| 30 | |
| 31 | #[cfg(test)] |
| 32 | mod tests { |