function addDirToLoginPath(currentPath, dir) {
            let parts = currentPath.split("/");
            let length = parts.length;
            if (length > 0) {
                parts[length - 1] = dir;
                return parts.join("/");
            }
            return dir;
        }
Rebuilds login file path given a selected directory to add.
@since 3.8.0

@param {string} currentPath current value of loginObj.login
@param {string} dir selected directory to append to login file path
@returns {string} new login path