user registration and authentication flow