Email authentication hook with automatic signup/login detectionHandles both new user signup and existing user login seamlessly.
New users: requestOtp → verifyOtp (creates account)
Existing users: requestOtp → verifyOtp (login)
Uses sessionStorage for ephemeral session secrets and localStorage for user data.
Supports session management with automatic expiry detection and refresh capabilities.