Add register page

This commit is contained in:
Jackzie 2025-04-15 20:33:06 -05:00
parent 8b401b6bc6
commit 1c561e58f7
5 changed files with 96 additions and 3 deletions

View file

@ -108,7 +108,7 @@ async fn rocket() -> _ {
api::library::move_file, api::library::upload_file, api::library::download_file, api::library::list_files, api::library::get_file, api::library::delete_file,
])
.mount("/auth", routes![
ui::auth::login
ui::auth::login, ui::auth::login_handler, ui::auth::register, ui::auth::register_handler,
])
.mount("/", routes![
ui::help::about,

View file

@ -6,8 +6,21 @@ pub async fn login(route: &Route) -> Template {
Template::render("auth/login", context! { route: route.uri.path() })
}
#[post("/login")]
pub async fn login_handler(route: &Route) -> Template {
Template::render("auth/login", context! { route: route.uri.path() })
}
#[get("/register")]
pub async fn register(route: &Route) -> Template {
Template::render("auth/register", context! { route: route.uri.path() })
}
#[post("/register")]
pub async fn register_handler(route: &Route) -> Template {
Template::render("auth/register", context! { route: route.uri.path() })
}