aboutsummaryrefslogtreecommitdiffstats
path: root/frontend/src/contexts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-09-03 21:45:38 -0700
committerPinapelz <yukais@pinapelz.com>2025-09-03 21:45:38 -0700
commit159cac6460fb2a42456c6f9a44cbcdb03b938823 (patch)
treefb39937774a9bdf99f932b2df6bcab433dcfe4bb /frontend/src/contexts
parentc8bae6ab79a32da0fe745ebb9401e14f86c1f0d8 (diff)
implement admin dashboard frontend and handle game creation
Diffstat (limited to 'frontend/src/contexts')
-rw-r--r--frontend/src/contexts/AuthContext.tsx6
1 files changed, 4 insertions, 2 deletions
diff --git a/frontend/src/contexts/AuthContext.tsx b/frontend/src/contexts/AuthContext.tsx
index 8abeeb4..09e4864 100644
--- a/frontend/src/contexts/AuthContext.tsx
+++ b/frontend/src/contexts/AuthContext.tsx
@@ -4,9 +4,10 @@ import { authApi } from '../utils/authApi';
import type { User as ApiUser, SessionResponse } from '../utils/authApi';
interface User {
- id: string;
+ id: number;
username: string;
email: string;
+ isAdmin: boolean;
}
interface AuthContextType {
@@ -40,9 +41,10 @@ export const AuthProvider: React.FC<AuthProviderProps> = ({ children }) => {
const isAuthenticated = user !== null;
const transformApiUser = (apiUser: ApiUser): User => ({
- id: apiUser.id.toString(),
+ id: apiUser.id,
username: apiUser.username,
email: apiUser.email,
+ isAdmin: apiUser.isAdmin,
});
const checkAuth = async () => {
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage