diff --git a/src/main.rs b/src/main.rs index 6a0fd8c..8bd49dd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -109,6 +109,16 @@ struct LoginData { password: String, } +#[derive(Serialize)] +struct EmptyContext { +} + +#[get("/login")] +fn login_form() -> Template { + let context = EmptyContext {}; + Template::render("login_form", &context) +} + #[post("/login", data = "")] fn login(form_data: Form) -> String { let auth = BasicAuthentication { @@ -188,6 +198,7 @@ fn routes() -> Vec { oidc_config, get_keys, login, + login_form, ] } diff --git a/templates/hello.html.tera b/templates/hello.html.tera index e696abd..8321d74 100644 --- a/templates/hello.html.tera +++ b/templates/hello.html.tera @@ -1,23 +1,6 @@ {% extends "base" %} {% block content %} -

Login

-
-
- Login -
- - - -
-
- - - -
-
- -
-
-
+

Hello?

+ Login {% endblock content %} diff --git a/templates/login_form.html.tera b/templates/login_form.html.tera new file mode 100644 index 0000000..e696abd --- /dev/null +++ b/templates/login_form.html.tera @@ -0,0 +1,23 @@ +{% extends "base" %} + +{% block content %} +

Login

+
+
+ Login +
+ + + +
+
+ + + +
+
+ +
+
+
+{% endblock content %}