Added login function to utils.py.