diff options
author | metamuffin <metamuffin@disroot.org> | 2023-06-05 20:10:49 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-06-05 20:10:49 +0200 |
commit | e9185e5fb133fbf62d7cc86e644d2f9d272ba719 (patch) | |
tree | 870a65751620314585471b5ae502dadb231ef621 /server/src/routes | |
parent | b0d77c36ba632b91d65047716ca0a3e4176eaf4c (diff) | |
download | jellything-e9185e5fb133fbf62d7cc86e644d2f9d272ba719.tar jellything-e9185e5fb133fbf62d7cc86e644d2f9d272ba719.tar.bz2 jellything-e9185e5fb133fbf62d7cc86e644d2f9d272ba719.tar.zst |
updatte
Diffstat (limited to 'server/src/routes')
-rw-r--r-- | server/src/routes/ui/account/mod.rs | 6 |
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 |