aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/routes')
-rw-r--r--server/src/routes/ui/account/mod.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/src/routes/ui/account/mod.rs b/server/src/routes/ui/account/mod.rs
index d4afb06..b778b64 100644
--- a/server/src/routes/ui/account/mod.rs
+++ b/server/src/routes/ui/account/mod.rs
@@ -15,7 +15,7 @@ use crate::{
CONF,
};
use anyhow::anyhow;
-use argon2::{Argon2, PasswordHasher};
+use argon2::{password_hash::Salt, Argon2, PasswordHasher};
use rocket::{
form::{Contextual, Form},
get,
@@ -206,12 +206,12 @@ pub fn format_form_error<T>(form: Form<Contextual<T>>) -> MyError {
}
MyError(anyhow!(k))
}
-
+
pub fn hash_password(username: &str, password: &str) -> Vec<u8> {
Argon2::default()
.hash_password(
format!("{username}\0{password}").as_bytes(),
- r"IYMa13osbNeLJKnQ1T8LlA",
+ <&str as TryInto<Salt>>::try_into("IYMa13osbNeLJKnQ1T8LlA").unwrap(),
)
.unwrap()
.hash