make append_path work, update todo

This commit is contained in:
Reid 2023-08-28 17:26:33 -07:00
parent fa1d23cb3e
commit 6bae7ef997
Signed by: reidlab
GPG key ID: 6C9EAA3364F962C8
5 changed files with 9 additions and 8 deletions

View file

@ -9,8 +9,8 @@
# boomlings.com/database/
# example.com/aaaaaaaaaa/
# ^^^^^^^^^^^
# leaving blank will disable this
append_path = ""
# leaving as "/" will disable this
append_path = "/"
# where can your server be accessible?
port = 8000

View file

@ -34,5 +34,5 @@ _these features are implemented_
## todo
- make the `append_path` option do something (atm doesnt work)
- move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs] + cache authorization
- move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs]
- make gjp2 authentication faster (bcrypt?)

View file

@ -14,7 +14,7 @@ pub struct FromLoginAccount {
password: String
}
#[post("/memaddrefix/accounts/loginGJAccount.php", data = "<input>")]
#[post("/accounts/loginGJAccount.php", data = "<input>")]
pub fn login_account(input: Form<FromLoginAccount>) -> status::Custom<&'static str> {
let connection = &mut db::establish_connection_pg();

View file

@ -16,7 +16,7 @@ pub struct FormRegisterAccount {
email: String
}
#[post("/memaddrefix/accounts/registerGJAccount.php", data = "<input>")]
#[post("/accounts/registerGJAccount.php", data = "<input>")]
pub fn register_account(input: Form<FormRegisterAccount>) -> status::Custom<&'static str> {
let connection = &mut db::establish_connection_pg();

View file

@ -25,8 +25,9 @@ fn rocket() -> _ {
rocket::build()
.configure(rocket::Config::figment().merge(("port", CONFIG.general.port)))
.mount("/", routes![
index,
index,
])
.mount(CONFIG.general.append_path.as_str(), routes![
endpoints::accounts::login_account::login_account,
endpoints::accounts::register_account::register_account
])