Finished user login functionality