diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/Cargo.toml | 20 | ||||
-rw-r--r-- | server/src/routes/ui/account/mod.rs | 6 |
2 files changed, 13 insertions, 13 deletions
diff --git a/server/Cargo.toml b/server/Cargo.toml index ed60d72..b73841e 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -7,22 +7,22 @@ edition = "2021" jellycommon = { path = "../common" } jellyremuxer = { path = "../remuxer" } -serde = { version = "1.0.152", features = ["derive"] } -serde_json = "1.0.91" +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.96" -log = "0.4.17" +log = "0.4.18" env_logger = "0.10.0" -anyhow = "1.0.68" -once_cell = "1.17.0" +anyhow = "1.0.71" +once_cell = "1.17.2" chashmap = "2.2.2" -argon2 = "0.4.1" +argon2 = "0.5.0" rand = "0.8.5" -chrono = { version = "0.4.23", features = ["serde"] } +chrono = { version = "0.4.26", features = ["serde"] } async-std = "1.12.0" -rocket = { version = "0.5.0-rc.2", features = ["secrets", "json"] } -tokio = { version = "1.24.1", features = ["io-util"] } -tokio-util = { version = "0.7.4", features = ["io", "io-util"] } +rocket = { version = "0.5.0-rc.3", features = ["secrets", "json"] } +tokio = { version = "1.28.2", features = ["io-util"] } +tokio-util = { version = "0.7.8", features = ["io", "io-util"] } markup = "0.13.1" sled = "0.34.7" 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 |