diff options
Diffstat (limited to 'frontend/src/contexts/AuthContext.tsx')
| -rw-r--r-- | frontend/src/contexts/AuthContext.tsx | 6 |
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 () => { |
