make append_path work, update todo
This commit is contained in:
parent
fa1d23cb3e
commit
6bae7ef997
5 changed files with 9 additions and 8 deletions
|
@ -9,8 +9,8 @@
|
||||||
# boomlings.com/database/
|
# boomlings.com/database/
|
||||||
# example.com/aaaaaaaaaa/
|
# example.com/aaaaaaaaaa/
|
||||||
# ^^^^^^^^^^^
|
# ^^^^^^^^^^^
|
||||||
# leaving blank will disable this
|
# leaving as "/" will disable this
|
||||||
append_path = ""
|
append_path = "/"
|
||||||
# where can your server be accessible?
|
# where can your server be accessible?
|
||||||
port = 8000
|
port = 8000
|
||||||
|
|
||||||
|
|
|
@ -34,5 +34,5 @@ _these features are implemented_
|
||||||
|
|
||||||
## todo
|
## todo
|
||||||
|
|
||||||
- make the `append_path` option do something (atm doesnt work)
|
- move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs]
|
||||||
- move authorization logic to (./src/helpers/accounts.rs)[./src/helpers/accounts.rs] + cache authorization
|
- make gjp2 authentication faster (bcrypt?)
|
|
@ -14,7 +14,7 @@ pub struct FromLoginAccount {
|
||||||
password: String
|
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> {
|
pub fn login_account(input: Form<FromLoginAccount>) -> status::Custom<&'static str> {
|
||||||
let connection = &mut db::establish_connection_pg();
|
let connection = &mut db::establish_connection_pg();
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub struct FormRegisterAccount {
|
||||||
email: String
|
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> {
|
pub fn register_account(input: Form<FormRegisterAccount>) -> status::Custom<&'static str> {
|
||||||
let connection = &mut db::establish_connection_pg();
|
let connection = &mut db::establish_connection_pg();
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,9 @@ fn rocket() -> _ {
|
||||||
rocket::build()
|
rocket::build()
|
||||||
.configure(rocket::Config::figment().merge(("port", CONFIG.general.port)))
|
.configure(rocket::Config::figment().merge(("port", CONFIG.general.port)))
|
||||||
.mount("/", routes![
|
.mount("/", routes![
|
||||||
index,
|
index,
|
||||||
|
])
|
||||||
|
.mount(CONFIG.general.append_path.as_str(), routes![
|
||||||
endpoints::accounts::login_account::login_account,
|
endpoints::accounts::login_account::login_account,
|
||||||
endpoints::accounts::register_account::register_account
|
endpoints::accounts::register_account::register_account
|
||||||
])
|
])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue