summaryrefslogtreecommitdiff
path: root/src/modules/auth/mod.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-05-30 02:18:27 +0200
committermetamuffin <metamuffin@disroot.org>2024-05-30 02:18:27 +0200
commit2b64fc57bbed04dd8249afcbbc6ac6849e05ba36 (patch)
treedd5f22f70c2996d79399bef4eeeacd25c2d86c69 /src/modules/auth/mod.rs
parent8d58647a5edebe8eb37ee8d24f2ffc2c400a655c (diff)
downloadgnix-ba36f5b14acae1b41b98fff98d04d4ff4eac1b0f.tar
gnix-ba36f5b14acae1b41b98fff98d04d4ff4eac1b0f.tar.bz2
gnix-ba36f5b14acae1b41b98fff98d04d4ff4eac1b0f.tar.zst
implment creds for http basic authv2.0.0
Diffstat (limited to 'src/modules/auth/mod.rs')
-rw-r--r--src/modules/auth/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/auth/mod.rs b/src/modules/auth/mod.rs
index d6e1a35..715ca97 100644
--- a/src/modules/auth/mod.rs
+++ b/src/modules/auth/mod.rs
@@ -19,12 +19,12 @@ struct Credentials {
}
impl Credentials {
- fn get(&self, usernamme: &str) -> &PasswordHashString {
- self.hashes.get(usernamme).unwrap_or(&self.wrong_user)
+ fn get(&self, username: &str) -> &PasswordHashString {
+ self.hashes.get(username).unwrap_or(&self.wrong_user)
}
- pub fn authentificate(&self, usernamme: &str, password: &str) -> bool {
+ pub fn authentificate(&self, username: &str, password: &str) -> bool {
let algo = Argon2::new(Algorithm::Argon2id, Version::V0x13, Params::default());
- let hash = self.get(usernamme);
+ let hash = self.get(username);
match hash.algorithm().as_str() {
"argon2id" => algo
.verify_password(