I have written the functionality for login