Function login() returns user data