From bd63083ee301f53b8268ab989f07d0225d86cfb7 Mon Sep 17 00:00:00 2001 From: Michael Mainguy Date: Fri, 13 Oct 2023 14:59:24 -0500 Subject: [PATCH] Updated user function --- src/integration/pouchdbPersistenceManager.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/integration/pouchdbPersistenceManager.ts b/src/integration/pouchdbPersistenceManager.ts index 399bc4b..15bcfc5 100644 --- a/src/integration/pouchdbPersistenceManager.ts +++ b/src/integration/pouchdbPersistenceManager.ts @@ -210,14 +210,18 @@ export class PouchdbPersistenceManager implements IPersistenceManager { private async beginSync() { try { - const syncTarget = "mike"; + const syncTarget = "user123"; const dbs = await axios.get('https://syncdb-service-d3f974de56ef.herokuapp.com/_all_dbs'); if (dbs.data.indexOf(syncTarget) == -1) { console.log('sync target missing'); return; } console.log(dbs); - this.remote = new PouchDB('https://syncdb-service-d3f974de56ef.herokuapp.com/' + syncTarget); + + this.remote = new PouchDB('https://syncdb-service-d3f974de56ef.herokuapp.com/' + syncTarget, + {auth: {username: syncTarget, password: 'password'}}); + + //this.remote.login(syncTarget, 'password'); this.syncDoc = this.syncDoc.bind(this); this.db.sync(this.remote, {live: true, retry: true}) .on('change', this.syncDoc);