When I connect heroku postgres database with Auth0 then i am getting below error.
could not connect to postgres db { [error: no pg_hba.conf entry for host "XXXXXXXX", user "XXXXXX", database "XXXXXX", SSL off]
name: 'error',
length: 161,
severity: 'FATAL',
code: '28000',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'auth.c',
line: '496',
routine: 'ClientAuthentication' }
[error] 28000 - undefined
I am using Auth0 so please find below auth0 code with heroku database details and URL.
configuration.config_file = "postgres://username:password@host:port/DB_name"
function login (email, password, callback) {
var conString = configuration.config_file;
postgres(conString, function (err, client) {
if (err) {
console.log('could not connect to postgres db', err);
return callback(err);
}
});
}