Git Product home page Git Product logo

Comments (11)

bawelter avatar bawelter commented on June 18, 2024

Does it fail if you pass the cookieName? The guard statement should be fine as it is the json object for the SessionAuthenticator and should be {"method": "session", "sessionId": "yoursessionid", "cookieName": "yourcookiename or nil"}. Maybe you created a guest session and you don't allow guest login from sync gateway.

from couchbase_lite.

matsunanaro avatar matsunanaro commented on June 18, 2024

No, it doesn't fail when I pass the cookieName, e.g. "SyncGatewaySession". But it fails when the cookieName is omitted. Since cookieName in SessionAuthenticator is declared as a named parameter; in other words it is supposed to be optional. And I believe its counterpart in Swift is optional too. I am afraid it is a little bug. By the way, I think BasicAuthenticator would have the same issue for those accounts without passwords.

from couchbase_lite.

matsunanaro avatar matsunanaro commented on June 18, 2024

One more thing - when the cookieName was omitted, the json map in my debugger was shown as Dictionary<String, Any> since the cookieName was set as NSNull. Hope this would help.

from couchbase_lite.

bawelter avatar bawelter commented on June 18, 2024

That's definitely what is happening. Good catch!

from couchbase_lite.

bawelter avatar bawelter commented on June 18, 2024

For now pass the cookieName, I don't have time to spend on this at the moment but you're welcome to make the changes and do a pull request with the fix in place. If you do this it won't take long for me to push the changes to flutter pub but you can use your code with the fix in place until that is live.

from couchbase_lite.

matsunanaro avatar matsunanaro commented on June 18, 2024

No problem. ActuallyI am thinking about making a fix and do a pull request. Hopefully, it will be available sometime next week. In the meantime, I've worked around the issue by setting the cookieName to SyncGatewaySession. Thanks for your quick response.

from couchbase_lite.

bawelter avatar bawelter commented on June 18, 2024

This was merged, I just need to push a new release and then I will close the issue.

from couchbase_lite.

eadistar avatar eadistar commented on June 18, 2024

with basicauthenticator everything works fine ,but with sessionauthentication automatic sync dosent working. Is this issue related the same you mentioned above?

from couchbase_lite.

matsunanaro avatar matsunanaro commented on June 18, 2024

It could be related. Please try to call the SessionAuthenticator constructor with the cookieName specified.

from couchbase_lite.

bawelter avatar bawelter commented on June 18, 2024

It could be related. Please try to call the SessionAuthenticator constructor with the cookieName specified.

I haven't released the change to the plugin on pub.dev yet so you can reference this repo instead and it should solve your issue.

from couchbase_lite.

bawelter avatar bawelter commented on June 18, 2024

v2.7.1+1 has this fix in it

from couchbase_lite.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.