37 lines
1.3 KiB
Rust
37 lines
1.3 KiB
Rust
use axum::extract::State;
|
|
use axum::response::IntoResponse;
|
|
use maud::html;
|
|
use tower_sessions::Session;
|
|
use crate::web::service::AppState;
|
|
use crate::web::service::routes::Route;
|
|
|
|
pub(crate) struct RegisterPrompt;
|
|
|
|
impl Route<'_, ()> for RegisterPrompt {
|
|
const PATH: &'static str = "/registerprompt";
|
|
|
|
async fn process(_session: Session, _state: State<AppState>, _query: ()) -> impl IntoResponse {
|
|
html! {
|
|
h1 { "Create an account" }
|
|
form hx-post="/auth/register" hx-target="#modal-content" hx-swap="innerHTML" {
|
|
label for="username" { "Username" }
|
|
input type="text" name="username" placeholder="Username" {}
|
|
|
|
label for="email" { "Email" }
|
|
input type="email" name="email" id="email" required;
|
|
|
|
label for="password" { "Password" }
|
|
input type="password" name="password" id="password"
|
|
required minlength="10" maxlength="128"
|
|
autocomplete="new-password";
|
|
|
|
label for="password_confirmation" { "Confirm password" }
|
|
input type="password" name="password_confirmation"
|
|
id="password_confirmation" required
|
|
autocomplete="new-password";
|
|
|
|
button type="submit" { "Register" }
|
|
}
|
|
}
|
|
}
|
|
} |