refactored login.js -> base.js