Created a login function.