default apikey is returned by metadata module if no apikey found, remove this code because is never going to be run

This commit is contained in:
Eneko Lakasta 2018-02-20 12:53:33 +01:00
parent 59ca00b33b
commit 521b441da5

View File

@ -53,23 +53,18 @@ PgConnection.prototype.setDBAuth = function(username, params, apikeyType, callba
//Remove this block when Auth fallback is not used anymore
// AUTH_FALLBACK
// master apikey has been recreated from user's metadata
if (!params.dbuser && apikey.user_id && apikey.type === 'master' && global.environment.postgres_auth_user) {
params.dbuser = _.template(global.environment.postgres_auth_user, apikey);
}
//Remove this block when Auth fallback is not used anymore
// AUTH_FALLBACK
// default apikey has been recreated from user's metadata
if (!params.dbpassword && global.environment.postgres.password) {
params.dbpassword = global.environment.postgres.password;
}
//Remove this block when Auth fallback is not used anymore
// AUTH_FALLBACK
// If api key not found use default
if (!params.dbuser && !params.dbpassword) {
return this.setDBAuth(username, params, 'default', callback);
}
return callback();
});
} else if (apikeyType === 'default') {