Compare commits
No commits in common. "793a8dcb7a89d4e6197520c55fef4d826507ee05" and "3cbf22cb832421154919c74fefaf81e3e086260b" have entirely different histories.
793a8dcb7a
...
3cbf22cb83
6 changed files with 7 additions and 8 deletions
|
@ -34,5 +34,6 @@ _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]
|
||||
- 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?)
|
|
@ -30,6 +30,5 @@ impl Config {
|
|||
|
||||
pub static CONFIG: LazyLock<Config> = LazyLock::new(|| {
|
||||
let config = Config::load_from_file("config.toml");
|
||||
|
||||
return config;
|
||||
config
|
||||
});
|
|
@ -30,7 +30,6 @@ pub fn login_account(input: Form<FromLoginAccount>) -> status::Custom<&'static s
|
|||
return status::Custom(Status::Ok, "-9")
|
||||
}
|
||||
|
||||
// account verification
|
||||
{
|
||||
use crate::schema::accounts::dsl::*;
|
||||
|
||||
|
@ -43,7 +42,7 @@ pub fn login_account(input: Form<FromLoginAccount>) -> 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::gjp::get_gjp2(input.password.clone()).as_bytes(), account_id_gjp2.1.as_str()) {
|
||||
match verify_password(helpers::gjp2::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())
|
||||
),
|
||||
|
|
|
@ -60,7 +60,7 @@ pub fn register_account(input: Form<FormRegisterAccount>) -> status::Custom<&'st
|
|||
|
||||
let new_account = NewAccount {
|
||||
username: input.userName.clone(),
|
||||
gjp2: helpers::gjp::get_gjp2_hashed(input.password.clone()),
|
||||
gjp2: helpers::gjp2::get_gjp2_hashed(input.password.clone()),
|
||||
email: input.email.clone()
|
||||
};
|
||||
inserted_account = diesel::insert_into(accounts)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
pub mod accounts;
|
||||
pub mod clean;
|
||||
pub mod format;
|
||||
pub mod gjp;
|
||||
pub mod gjp2;
|
Loading…
Add table
Add a link
Reference in a new issue