Logging in from register page redirects to home