add db constraints; add optional name for login (to be sent to members)
This commit is contained in:
@ -18,14 +18,18 @@ use crate::model::{
|
||||
user::{LoginError, User},
|
||||
};
|
||||
|
||||
#[get("/")]
|
||||
fn index(flash: Option<FlashMessage<'_>>) -> Template {
|
||||
#[get("/?<name>")]
|
||||
fn index(flash: Option<FlashMessage<'_>>, name: Option<String>) -> Template {
|
||||
let mut context = tera::Context::new();
|
||||
|
||||
if let Some(msg) = flash {
|
||||
context.insert("flash", &msg.into_inner());
|
||||
}
|
||||
|
||||
if let Some(n) = name {
|
||||
context.insert("name", &n);
|
||||
}
|
||||
|
||||
Template::render("auth/login", context.into_json())
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user