src/setup/auth-service.js
function checkAuth (auth) {
    if (util.isUndefined(auth)) {
        throw new CartoValidationError('\'auth\'', CartoValidationErrorTypes.MISSING_REQUIRED);
    }
    if (!util.isObject(auth)) {
        throw new CartoValidationError('\'auth\' property must be an object.', CartoValidationErrorTypes.INCORRECT_TYPE);
    }
    auth.username = util.isUndefined(auth.username) ? auth.user : auth.username; // backwards compatibility
    checkApiKey(auth.apiKey);
    checkUsername(auth.username);
}
function checkAuth (auth) {
    if (util.isUndefined(auth)) {
        throw new CartoValidationError('\'auth\'', CartoValidationErrorTypes.MISSING_REQUIRED);
    }
    if (!util.isObject(auth)) {
        throw new CartoValidationError('\'auth\' property must be an object.', CartoValidationErrorTypes.INCORRECT_TYPE);
    }
    auth.username = util.isUndefined(auth.username) ? auth.user : auth.username; // backwards compatibility
    checkApiKey(auth.apiKey);
    checkUsername(auth.username);
}
function checkAuth ( auth ) { if ( util . isUndefined ( auth ) ) { throw new CartoValidationError ( '\'auth\'' , CartoValidationErrorTypes . MISSING_REQUIRED ) ; } if ( ! util . isObject ( auth ) ) { throw new CartoValidationError ( '\'auth\' property must be an object.' , CartoValidationErrorTypes . INCORRECT_TYPE ) ; } auth . username = util . isUndefined ( auth . username ) ? auth . user : auth . username ; // backwards compatibility checkApiKey ( auth . apiKey ) ; checkUsername ( auth . username ) ; }
Check a valid auth parameter.

@param  {Object} auth
Check a valid auth parameter .