Added rest of the login logic in js file