I'm sorry, my header is correct. I was writing this post without code in front of my eyes. Sync gateway correctly authenticate the user. I'm testing it on PhoneGap directly. Problem is that I have no feedback, when the session expires. There is no errors in _active_tasks. Also when user is trying to start the replication without valid session, task appears with no errors and status "Processed 0/0" and after few moments, when SG reject authorization, task disappear. I'm never getting error array in tasks.
W dniu środa, 2 września 2015 11:25:49 UTC+2 użytkownik James Nocentini napisał: > > Check this example for `/_replicate` endpoint with the custom header > <http://developer.couchbase.com/documentation/mobile/1.1.0/develop/references/couchbase-lite/rest-api/server/post-replicate/index.html#example>. > > I think headers takes an object and not a string. > Also, how are you testing this endpoint? Are you running a PhoneGap app or > using curl/httpie to send the request to the CBLite server? > > James > > On Tuesday, 1 September 2015 16:29:46 UTC+1, Jakub Kowalski wrote: >> >> Hey, >> >> My problem is similar to this: >> https://github.com/couchbase/couchbase-lite-ios/issues/565 but this >> issue is closed and maybe I'm doing something wrong. >> I want to handle custom session expiration, but when Sync Gateway returns >> 401, I'm getting "Processed 0/0" task status. >> >> Everything is based on Phonegap TodoLite example, with difference that >> I'm using custom session cookie instead of facebook token, so my sync >> definition looks similar to this: >> >> source : { >> "url": "http://address:4984/my_db", >> "headers" : "SyncGatewaySession=a8s7df69a87s6d9f7a98s766df97a6s" >> }, >> target : "my_db", >> continuous : true >> >> >> I've tried also with original TodoLite example, connecting it to my sync >> gateway and removing session cookie from database. Result is the same. 401 >> from sync gateway, auth-challenge handler is not called. >> >> -- You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/8e2616e3-2024-45ce-bff0-9b3ef80d7231%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
