diff --git a/idp/src/main.rs b/idp/src/main.rs index fdbd15f..b9d3f53 100644 --- a/idp/src/main.rs +++ b/idp/src/main.rs @@ -54,7 +54,8 @@ async fn main() -> Result<()> { .wrap_err("running migrations")?; let app = Router::::new() - .route("/", get::<_, _, Db>(root)) + .route("/style.css", get(style_css)) + .route("/", get(root)) .route("/signup", get(signup).post(signup_post)) .route("/login", get(login).post(login_post)) .route("/users", get(users)) @@ -68,6 +69,14 @@ async fn main() -> Result<()> { axum::serve(listener, app).await.wrap_err("serving app") } +async fn style_css() -> impl IntoResponse { + let header = [( + axum::http::header::CONTENT_TYPE, + axum::http::HeaderValue::from_static("text/css; charset=utf-8"), + )]; + (header, include_str!("../templates/style.css")) +} + async fn root(session: UserSession) -> impl IntoResponse { #[derive(askama::Template)] #[template(path = "index.html")] diff --git a/idp/templates/index.html b/idp/templates/index.html index 6a9a0fb..13cbb05 100644 --- a/idp/templates/index.html +++ b/idp/templates/index.html @@ -4,6 +4,7 @@ IDP +

Your favorite identity provider

diff --git a/idp/templates/login.html b/idp/templates/login.html index f89a829..8d33115 100644 --- a/idp/templates/login.html +++ b/idp/templates/login.html @@ -4,6 +4,7 @@ Login - IDP +

Log into your beautiful account

diff --git a/idp/templates/signup.html b/idp/templates/signup.html index e9f01cb..fee01a9 100644 --- a/idp/templates/signup.html +++ b/idp/templates/signup.html @@ -4,6 +4,7 @@ Signup - IDP +

Create a new account

diff --git a/idp/templates/style.css b/idp/templates/style.css new file mode 100644 index 0000000..a8ec5c0 --- /dev/null +++ b/idp/templates/style.css @@ -0,0 +1,21 @@ +html, +body { + width: 100%; +} + +body { + display: flex; + flex-direction: column; + align-items: center; +} + +/* Home Link */ +a[href="/"] { + margin-bottom: 20px; +} + +form { + display: flex; + flex-direction: column; + gap: 10px; +} \ No newline at end of file diff --git a/idp/templates/users.html b/idp/templates/users.html index 39ed88c..6067ac2 100644 --- a/idp/templates/users.html +++ b/idp/templates/users.html @@ -4,6 +4,7 @@ Users - IDP +

Your favorite identity provider