Increase the number of request/s for sign_in/sign_up
authorGreg Burri <greg.burri@gmail.com>
Tue, 11 Mar 2025 13:42:13 +0000 (14:42 +0100)
committerGreg Burri <greg.burri@gmail.com>
Tue, 11 Mar 2025 13:42:13 +0000 (14:42 +0100)
backend/src/consts.rs
backend/src/hash.rs

index 7fdbb4e..5b65489 100644 (file)
@@ -18,8 +18,8 @@ pub const TOKEN_SIZE: usize = 32;
 
 pub const SEND_EMAIL_TIMEOUT: Duration = Duration::from_secs(60);
 
-pub const NUMBER_OF_CONCURRENT_HTTP_REQUEST_FOR_RATE_LIMIT: u64 = 20;
-pub const DURATION_FOR_RATE_LIMIT: Duration = Duration::from_secs(5);
+pub const NUMBER_OF_CONCURRENT_HTTP_REQUEST_FOR_RATE_LIMIT: u64 = 10;
+pub const DURATION_FOR_RATE_LIMIT: Duration = Duration::from_secs(2);
 
 // HTTP headers, see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers.
 // Common headers can be found in 'axum::http::header' (which is a re-export of the create 'http').
index cb70199..c2626ad 100644 (file)
@@ -6,6 +6,8 @@ use argon2::{
 };
 
 fn get_argon2<'k>() -> Argon2<'k> {
+    // Note: It's not neccessary to have only one Argon2 object, creating a new one
+    // when we need it is lightweight.
     Argon2::new(
         argon2::Algorithm::Argon2id,
         argon2::Version::V0x13,