Register form and confirmation messages
This commit is contained in:
11
src/routes/register.rs
Normal file
11
src/routes/register.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
use axum::response::{Html, IntoResponse, Response};
|
||||
use axum_messages::Messages;
|
||||
use std::fmt::Write;
|
||||
|
||||
pub async fn register(messages: Messages) -> Response {
|
||||
let mut error_html = String::new();
|
||||
for message in messages {
|
||||
writeln!(error_html, "<p><i>{}</i></p>", message).unwrap();
|
||||
}
|
||||
Html(format!(include_str!("register/register.html"), error_html)).into_response()
|
||||
}
|
||||
Reference in New Issue
Block a user