Add a session manager

This commit is contained in:
Nettika 2026-01-25 15:59:00 -08:00
parent a778d590f8
commit 3ce2fb04eb
No known key found for this signature in database
2 changed files with 25 additions and 22 deletions

View file

@ -12,9 +12,8 @@
[x] Create a `GET /new-project` endpoint that returns a HTML page with a project creation form. Keep it simple.
[x] Add .env file support using the dotenv crate. Load environment variables on server startup.
[x] Create a `GET /login` endpoint that returns a simple HTML login form (username and password fields).
[ ] Create a `POST /login` endpoint that validates credentials against USERNAME and PASSWORD environment variables. On success, set a session cookie.
[ ] Implement session management. Create a simple in-memory session store that tracks authenticated sessions by cookie token.
[ ] Add authentication middleware or helper function to check if a request has a valid session cookie.
[x] Add a rouille::session manager to set a session cookie.
[ ] Create a `POST /login` endpoint that validates credentials against USERNAME and PASSWORD environment variables.
[ ] Protect write endpoints (POST /projects, and any future write operations) with authentication. Redirect to /login if not authenticated.
[ ] Add a login button to the front page (GET /projects) that links to /login.
[ ] When logged in, show a "Create Project" button on the front page that links to /new-project.