conditionally apply username and password to couchdb auth
This commit is contained in:
parent
1a9a61f92c
commit
87bf640a5d
|
@ -12,10 +12,13 @@ PouchDB.adapter("writableStream", replicationStream.adapters.writableStream)
|
|||
|
||||
let POUCH_DB_DEFAULTS = {
|
||||
prefix: COUCH_DB_URL,
|
||||
auth: {
|
||||
}
|
||||
|
||||
if (env.COUCH_DB_USERNAME && env.COUCH_DB_PASSWORD) {
|
||||
POUCH_DB_DEFAULTS.auth = {
|
||||
username: env.COUCH_DB_USERNAME,
|
||||
password: env.COUCH_DB_PASSWORD,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
if (env.isTest()) {
|
||||
|
|
|
@ -7,10 +7,13 @@ const COUCH_DB_URL = env.COUCH_DB_URL || "http://localhost:10000/db/"
|
|||
|
||||
let POUCH_DB_DEFAULTS = {
|
||||
prefix: COUCH_DB_URL,
|
||||
auth: {
|
||||
}
|
||||
|
||||
if (env.COUCH_DB_USERNAME && env.COUCH_DB_PASSWORD) {
|
||||
POUCH_DB_DEFAULTS.auth = {
|
||||
username: env.COUCH_DB_USERNAME,
|
||||
password: env.COUCH_DB_PASSWORD,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
if (env.isTest()) {
|
||||
|
|
Loading…
Reference in New Issue