]> Repos - crimata-os/commit
Add multi-user auth with sessions and login UI
authorAndrew Gundersen <adgundersen@gmail.com>
Fri, 27 Feb 2026 16:33:07 +0000 (11:33 -0500)
committerAndrew Gundersen <adgundersen@gmail.com>
Fri, 27 Feb 2026 16:33:07 +0000 (11:33 -0500)
commit44f3192b78e88ac8aa0f6f064b743da81f6288ed
treeb547748c630e6846c632d5cbe1a19c12b5ee2419
parentac3215abf58d273d329d9ae3f93190a4417db07f
Add multi-user auth with sessions and login UI

- auth: POST /auth validates PAM, returns session token
- auth: GET /me validates Bearer token, returns username
- auth: POST /logout destroys session
- auth: POST /users creates Linux user via useradd+chpasswd
- session.c: in-memory token store (1024 slots, pthread mutex, /dev/urandom tokens)
- user.c: fork/exec useradd + chpasswd with username validation
- ui: login overlay shown until authenticated (x-cloak)
- ui: token persisted in sessionStorage, validated on page load
- ui: username displayed in dock after login
- ui: apps only load after successful auth

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
auth/Makefile
auth/src/main.c
auth/src/session.c [new file with mode: 0644]
auth/src/session.h [new file with mode: 0644]
auth/src/user.c [new file with mode: 0644]
auth/src/user.h [new file with mode: 0644]
ui/index.html
ui/js/os.js
ui/styles/canvas.css
ui/styles/login.css [new file with mode: 0644]