Am using technologies as (Couchbase-Lite,Ionic and syncgateway) when syncgateway started with guest couchbase-lite able to pull requests but when I disable guest and try to use pull request with custom header as Cookie with Syncgatewaysession id not able to pull requests.
Cordovaplugin Which I am using:
cordova plugin add https://github.com/couchbaselabs/Couchbase-Lite-PhoneGap-Plugin.git
Syncgateway Config File:
{
“log”: [""],
“CORS”: {
“origin”: [""],
“loginOrigin”: [""],
“headers”: [“Content-Type”, “Cookie”],
“maxAge”: 1728000
},
“adminInterface”: “10.0.1.213:4985”,
“interface”: “10.0.1.213:4984”,
“databases”: {
“test”: {
“server”: “http://10.0.1.135:8091”,
“bucket”: “test”,
“username”: “test”,
“password”: “test”,
“import_docs”: true
},
“taa_gateway”: {
“server”: “http://10.0.1.135:8091”,
“bucket”: “taa-app”,
“username”: “taa-app”,
“import_docs”: true,
“password”: “taa-app”,
“users”: {
“GUEST”: {
“disabled”: true,
“admin_channels”: [""]
},
“shiva”: {
“disabled”: false,
“password”: “ktree123”,
“admin_channels”: [“admin”, “editor”]
}
},
“sync”: function(doc,olddoc){ channel(doc.channels); }
}
}
}
Angular Code:
/*
Session Id I created directly from admin API for testing purpose and using… it has expiry for 2 days more.
*/
var cookie = “SyncGatewaySession=ad33bcf2dafdbbe99bd3e416e9fa84fd8e0d9b82”;
var source = {
“url”: url,
“Cookie”: cookie
};
couchlite.messages.replicate(source, tableName, {
replication_id: ‘inbox-intial-sync’,
continuous: true
}).then(function(result) {
console.log(result);
$state.go(‘main.inbox’);
}, function(error) {
console.error("from live ERROR -> " + JSON.stringify(error));
});
Any one else facing this kind of issue?