feat: redesign UI with sidebar, centered login, account page with password reset
Some checks failed
Build & Release / build (push) Failing after 5s

This commit is contained in:
Ryan Moon
2026-04-03 15:13:46 -05:00
parent 2264ecc2f6
commit ceacd9b459
2 changed files with 253 additions and 39 deletions

View File

@@ -67,4 +67,12 @@ export async function authRoutes(app: FastifyInstance) {
app.get("/auth/me", { onRequest: [app.authenticate] }, async (req) => {
return { username: (req.user as { username: string }).username };
});
app.post("/auth/password", { onRequest: [app.authenticate] }, async (req, reply) => {
const { password } = z.object({ password: z.string().min(12) }).parse(req.body);
const { sub } = req.user as { sub: number };
const hash = await Bun.password.hash(password);
await db`UPDATE users SET password_hash = ${hash} WHERE id = ${sub}`;
return { ok: true };
});
}