# Authentication

### Using the Auth Hook

```typescript
import { useAuth } from "@/hooks/use-auth";

function MyComponent() {
  const { user, isAuthenticated, signIn, signOut } = useAuth();

  if (!isAuthenticated) {
    return <Text>Please sign in</Text>;
  }

  return <Text>Welcome, {user?.name}!</Text>;
}
```

### Using the Session Hook

```typescript
import { useSession } from "@/hooks/use-session";

function MyComponent() {
  const { session, user, isPending } = useSession();

  if (isPending) return <Text>Loading...</Text>;

  return <Text>Email: {user?.email}</Text>;
}
```

### Protected Routes

Routes in `(home)` are automatically protected. The `AuthWrapper` component handles redirects based on authentication status.