From 70e92fdbc8a02e8a066ccb70f2129a4611881427 Mon Sep 17 00:00:00 2001 From: himansig7 Date: Sat, 27 Sep 2025 19:33:00 -0700 Subject: [PATCH] fixed bug for admin info showing to all users problem was in AuthContext.tsx line needed to be changed into : if (userInfo.data.email === 'cses@ucsd.edu' || userInfo.data.email === 'h4gupta@ucsd.edu') because just keeping it as || 'h4gupta' would automatically say true. --- frontend/src/App.tsx | 2 +- frontend/src/context/AuthContext.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 6dd26a0d..1c3084a8 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -28,7 +28,7 @@ function App() { } /> } /> } /> - {/* } /> */} + } /> } /> } /> } /> diff --git a/frontend/src/context/AuthContext.tsx b/frontend/src/context/AuthContext.tsx index a1167e12..9fcfc3be 100644 --- a/frontend/src/context/AuthContext.tsx +++ b/frontend/src/context/AuthContext.tsx @@ -69,7 +69,7 @@ const AuthProvider = ({ children }: AuthProviderProps) => { setUser(userInfo.data); setIsUcsdEmail(true); // Check if user is admin - if (userInfo.data.email === 'cses@ucsd.edu' || 'ssenthilram@ucsd.edu' || 'h4gupta@ucsd.edu') { + if (userInfo.data.email === 'cses@ucsd.edu' || userInfo.data.email === 'h4gupta@ucsd.edu') { setIsAdmin(true); } else { setIsAdmin(false);