diff --git a/apps/web/src/hooks/useAuthInfo.ts b/apps/web/src/hooks/useAuthInfo.ts index b2e17a81..f3fb1d38 100644 --- a/apps/web/src/hooks/useAuthInfo.ts +++ b/apps/web/src/hooks/useAuthInfo.ts @@ -1,10 +1,16 @@ import { useEffect } from 'react'; -import useAuthStore from '@/stores/useAuthStore'; +import useAuthStore, { AuthInfo } from '@/stores/useAuthStore'; import { useUserProfileOfMe } from './api/user'; -const useAuthInfo = () => { +interface AuthInfoReturn { + isLoading: boolean; + isAuthenticated: boolean; + authInfo: AuthInfo | null; +} + +const useAuthInfo = (): AuthInfoReturn => { const { data: user, isError } = useUserProfileOfMe(); const isAuthenticated = useAuthStore((state) => state.isAuthenticated); const authInfo = useAuthStore((state) => state.authInfo); diff --git a/apps/web/src/stores/useAuthStore.ts b/apps/web/src/stores/useAuthStore.ts index 52ee63ba..73a8da21 100644 --- a/apps/web/src/stores/useAuthStore.ts +++ b/apps/web/src/stores/useAuthStore.ts @@ -2,7 +2,7 @@ import { create } from 'zustand'; import { persist } from 'zustand/middleware'; import { Provider } from '@repo/types'; -interface AuthInfo { +export interface AuthInfo { nickname: string; profileImageUrl: string; provider: Provider;