feat: add authentication system (login, users, auth middleware)
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

- server/auth.js: JWT middleware and auth routes
- src/stores/auth.js + useAuthFetch.js: client-side auth state
- src/views/LoginView.vue + UsersView.vue: login and user management UI
- router, sidebar, App.vue: guard routes behind auth
- COOLIFY.md: add real deployment IDs
This commit is contained in:
alexandrump
2026-04-22 01:22:05 +02:00
parent 0a97e51dc6
commit 898d021ae8
14 changed files with 819 additions and 123 deletions

View File

@@ -0,0 +1,15 @@
import { useAuthStore } from "../stores/auth";
export function useAuthFetch() {
function authFetch(url, options = {}) {
const auth = useAuthStore();
const headers = {
"Content-Type": "application/json",
...(options.headers || {}),
};
if (auth.token) headers["Authorization"] = `Bearer ${auth.token}`;
return fetch(url, { ...options, headers });
}
return { authFetch };
}