Fix user registration and auto-login.