Initial commit - frontend

This commit is contained in:
Bailey Taylor
2025-09-19 03:26:52 +00:00
commit 27e9a08ee0
234 changed files with 32097 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
// src/app/admin/users/page.tsx
import { cookies } from 'next/headers';
import { requireAuthOrRedirect } from '@/lib/authServer';
import axiosServer from '@/lib/axiosServer';
import UserTableSection from '@/components/admin/UserTableSection';
interface UserDTO {
id: number;
username: string;
displayName: string;
firstName: string;
lastName: string;
email: string;
role: string;
clientName: string;
enabled: boolean;
}
export default async function UserManagementPage() {
const user = await requireAuthOrRedirect();
const cookieStore = cookies();
// @ts-expect-error - cookies() is not actually async, type is misleading
const token = cookieStore.get('authToken')?.value;
const res = await axiosServer.get('/admin/users', {
headers: {
Authorization: `Bearer ${user.token}`, // token is guaranteed to exist
},
});
const users: UserDTO[] = res.data;
return <UserTableSection initialUsers={users} />;
}