register user and login