Added login function in user controller