Moved login logic from app.js to userAuthenticate.js.