This commit is contained in:
nora 2025-07-12 21:46:13 +02:00
parent 1772e21364
commit 0f46ff5a89
6 changed files with 35 additions and 1 deletions

View file

@ -54,7 +54,8 @@ async fn main() -> Result<()> {
.wrap_err("running migrations")?;
let app = Router::<Db>::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")]

View file

@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>IDP</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>Your favorite identity provider</h1>

View file

@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Login - IDP</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>Log into your beautiful account</h1>

View file

@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Signup - IDP</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>Create a new account</h1>

21
idp/templates/style.css Normal file
View file

@ -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;
}

View file

@ -4,6 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Users - IDP</title>
<link rel="stylesheet" href="/style.css" />
</head>
<body>
<h1>Your favorite identity provider</h1>