mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
update argon2 dep
This commit is contained in:
@ -16,7 +16,7 @@ env_logger.workspace = true
|
||||
log = "0.4"
|
||||
once_cell = "1"
|
||||
r2d2 = "0.8"
|
||||
rust-argon2 = "1"
|
||||
rust-argon2 = "2"
|
||||
serde_json.workspace = true
|
||||
serde.workspace = true
|
||||
sparkpost = "0.5"
|
||||
|
@ -1,4 +1,3 @@
|
||||
use argon2::{self, Config};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use crate::errors::ServiceError;
|
||||
@ -10,9 +9,9 @@ const SALT: &[u8] = b"supersecuresalt";
|
||||
|
||||
// PLEASE NOTE THIS IS ONLY FOR DEMO PLEASE DO MORE RESEARCH FOR PRODUCTION USE
|
||||
pub fn hash_password(password: &str) -> Result<String, ServiceError> {
|
||||
let config = Config {
|
||||
let config = argon2::Config {
|
||||
secret: SECRET_KEY.as_bytes(),
|
||||
..Default::default()
|
||||
..argon2::Config::rfc9106_low_mem()
|
||||
};
|
||||
argon2::hash_encoded(password.as_bytes(), SALT, &config).map_err(|err| {
|
||||
dbg!(err);
|
||||
|
Reference in New Issue
Block a user