- Complete Expo React Native app setup with TypeScript - Better Auth authentication system integration - Secure storage implementation for session tokens - Authentication flow with login/logout functionality - API client configuration for backend communication - Responsive UI components with themed styling - Expo Router navigation setup - Development configuration and scripts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
14 lines
309 B
TypeScript
14 lines
309 B
TypeScript
import { useSession } from "@/lib/auth/client";
|
|
|
|
export function useAuth() {
|
|
const { data: session, isPending, error } = useSession();
|
|
|
|
return {
|
|
user: session?.user ?? null,
|
|
session: session ?? null,
|
|
isLoading: isPending,
|
|
isAuthenticated: !!session?.user,
|
|
error: error ?? null,
|
|
};
|
|
}
|