From 609c00fca1659615e08069dec2de0547b5531367 Mon Sep 17 00:00:00 2001 From: reidlab Date: Wed, 30 Aug 2023 16:57:11 -0700 Subject: [PATCH 1/4] add return clause + update todo --- readme.md | 3 +-- src/config.rs | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/readme.md b/readme.md index 745efad..0ae7e80 100644 --- a/readme.md +++ b/readme.md @@ -35,5 +35,4 @@ _these features are implemented_ ## todo - find out why the last user's colors in getusers are broken???? (might be rubrub issue !!) -- move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs] -- make gjp2 authentication faster (bcrypt?) \ No newline at end of file +- move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs] \ No newline at end of file diff --git a/src/config.rs b/src/config.rs index 805c622..ee9a2aa 100644 --- a/src/config.rs +++ b/src/config.rs @@ -30,5 +30,6 @@ impl Config { pub static CONFIG: LazyLock = LazyLock::new(|| { let config = Config::load_from_file("config.toml"); - config + + return config; }); \ No newline at end of file From fc9c120076d6a3a52c3590060cc7da8b0537a368 Mon Sep 17 00:00:00 2001 From: reidlab Date: Thu, 31 Aug 2023 00:34:09 -0700 Subject: [PATCH 2/4] remove fix outside my control --- readme.md | 1 - 1 file changed, 1 deletion(-) diff --git a/readme.md b/readme.md index 0ae7e80..35c1143 100644 --- a/readme.md +++ b/readme.md @@ -34,5 +34,4 @@ _these features are implemented_ ## todo -- find out why the last user's colors in getusers are broken???? (might be rubrub issue !!) - move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs] \ No newline at end of file From 45a2cca6f66abd95123bb198e96fd82a9c8217e1 Mon Sep 17 00:00:00 2001 From: reidlab Date: Thu, 31 Aug 2023 01:09:52 -0700 Subject: [PATCH 3/4] rename gjp2 to gjp --- src/endpoints/accounts/login_account.rs | 3 ++- src/endpoints/accounts/register_account.rs | 2 +- src/helpers.rs | 2 +- src/helpers/{gjp2.rs => gjp.rs} | 0 4 files changed, 4 insertions(+), 3 deletions(-) rename src/helpers/{gjp2.rs => gjp.rs} (100%) diff --git a/src/endpoints/accounts/login_account.rs b/src/endpoints/accounts/login_account.rs index 8c52c0b..f21cbd3 100644 --- a/src/endpoints/accounts/login_account.rs +++ b/src/endpoints/accounts/login_account.rs @@ -30,6 +30,7 @@ pub fn login_account(input: Form) -> status::Custom<&'static s return status::Custom(Status::Ok, "-9") } + // account verification { use crate::schema::accounts::dsl::*; @@ -42,7 +43,7 @@ pub fn login_account(input: Form) -> status::Custom<&'static s Ok(account_id_gjp2) => { let user_id = helpers::accounts::get_user_id_from_account_id(account_id_gjp2.0); - match verify_password(helpers::gjp2::get_gjp2(input.password.clone()).as_bytes(), account_id_gjp2.1.as_str()) { + match verify_password(helpers::gjp::get_gjp2(input.password.clone()).as_bytes(), account_id_gjp2.1.as_str()) { Ok(_) => return status::Custom(Status::Ok, Box::leak(format!("{},{}", account_id_gjp2.0, user_id).into_boxed_str()) ), diff --git a/src/endpoints/accounts/register_account.rs b/src/endpoints/accounts/register_account.rs index 583ca2a..1dc7b04 100644 --- a/src/endpoints/accounts/register_account.rs +++ b/src/endpoints/accounts/register_account.rs @@ -60,7 +60,7 @@ pub fn register_account(input: Form) -> status::Custom<&'st let new_account = NewAccount { username: input.userName.clone(), - gjp2: helpers::gjp2::get_gjp2_hashed(input.password.clone()), + gjp2: helpers::gjp::get_gjp2_hashed(input.password.clone()), email: input.email.clone() }; inserted_account = diesel::insert_into(accounts) diff --git a/src/helpers.rs b/src/helpers.rs index d4d9ee6..4802350 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,4 +1,4 @@ pub mod accounts; pub mod clean; pub mod format; -pub mod gjp2; \ No newline at end of file +pub mod gjp; \ No newline at end of file diff --git a/src/helpers/gjp2.rs b/src/helpers/gjp.rs similarity index 100% rename from src/helpers/gjp2.rs rename to src/helpers/gjp.rs From 793a8dcb7a89d4e6197520c55fef4d826507ee05 Mon Sep 17 00:00:00 2001 From: reidlab Date: Thu, 31 Aug 2023 01:17:32 -0700 Subject: [PATCH 4/4] update todo --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 35c1143..e594f53 100644 --- a/readme.md +++ b/readme.md @@ -34,4 +34,5 @@ _these features are implemented_ ## todo +- fix gd not parsing the response from get_users correctly (sometimes has a hashtag in it? sometimes not? idfk) - move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs] \ No newline at end of file