File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import {
1919} from '../utils/LocalStorageUtils' ;
2020import { signInWithEmailAndPassword , applyActionCode , checkActionCode } from 'firebase/auth' ;
2121import { auth } from '@/config/firebase' ;
22+ import { clearAuthCache } from '@/hooks/useAuthGuard' ;
2223
2324// Validation helper
2425const validateEmail = ( email : string ) : boolean => {
@@ -158,6 +159,7 @@ export const logout = async (): Promise<boolean> => {
158159 } finally {
159160 // Always clear localStorage and sign out from Firebase regardless of backend API success/failure
160161 localStorage . removeItem ( AUTHENTICATED_USER_KEY ) ;
162+ clearAuthCache ( ) ;
161163 try {
162164 await firebaseSignOut ( auth ) ;
163165 } catch ( firebaseError ) {
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { useRouter } from 'next/router';
55import { FiFolder , FiLoader , FiLogOut } from 'react-icons/fi' ;
66import { LabelSmall } from '@/components/ui/text-styles' ;
77import { COLORS , shadow } from '@/constants/colors' ;
8+ import { logout } from '@/APIClients/authAPIClient' ;
89
910export const AdminHeader : React . FC = ( ) => {
1011 const router = useRouter ( ) ;
@@ -17,6 +18,10 @@ export const AdminHeader: React.FC = () => {
1718 router . push ( '/admin/directory' ) ;
1819 } ;
1920
21+ const handleSignOut = async ( ) => {
22+ await logout ( ) ;
23+ } ;
24+
2025 return (
2126 < Box
2227 w = "full"
@@ -62,7 +67,14 @@ export const AdminHeader: React.FC = () => {
6267 < FiLoader size = "16px" color = { COLORS . gray700 } />
6368 < LabelSmall color = { COLORS . gray700 } > Progress Tracker</ LabelSmall >
6469 </ Flex >
65- < Flex align = "center" gap = "8px" cursor = "pointer" >
70+ < Flex
71+ align = "center"
72+ gap = "8px"
73+ cursor = "pointer"
74+ onClick = { handleSignOut }
75+ _hover = { { opacity : 0.7 } }
76+ transition = "opacity 0.2s"
77+ >
6678 < FiLogOut size = "16px" color = { COLORS . gray700 } />
6779 < LabelSmall color = { COLORS . gray700 } > Sign Out</ LabelSmall >
6880 </ Flex >
Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ export default function Directory() {
484484 _hover = { { color : COLORS . veniceBlue } }
485485 onClick = { ( ) => router . push ( `/admin/users/${ user . id } ` ) }
486486 >
487- { displayName }
487+ { displayName || user . email }
488488 </ Text >
489489 </ Table . Cell >
490490 < Table . Cell py = { 1.5 } verticalAlign = "middle" >
You can’t perform that action at this time.
0 commit comments