-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
authorization error due to pouchdb change #840
Comments
I tried forcing pouchdb and rxdb to always include credentials: PouchDB.defaults({
fetch(url: any, opts: any) {
opts.credentials = 'include'
return (PouchDB as any).fetch(url, opts)
},
} as PouchDB.Configuration.RemoteDatabaseConfiguration) and: await userDb.collection({
name: 'user',
schema: userDocSchema,
pouchSettings: {
fetch(url: any, opts: any) {
opts.credentials = 'include'
return (PouchDB as any).fetch(url, opts)
},
} as PouchDB.Configuration.RemoteDatabaseConfiguration,
}) but that does not solve the issue. |
A quick workaround could be to remove rxdbs pouchdb-folder and install an older version of pouchdb. |
even though it would be a breaking change before? (v6.x versus v7) |
I tried installing [email protected] and enforcing it's use by adding it as resolution in package.json (using yarn). But cookies are still not sent. |
Went back to [email protected] and [email protected]. Still no cookies sent. Then I deleted the pouchdb-js file in node_modules/rxdb/dist/lib/ and also in the src folder. Still no cookies sent. My only temporary but horrible hack is to not write members into the security docs of the databases I am working with. Hoping that this will all work, once pouchdb and pouchdb-authentication update. This is now o.k. for me as this app is in development and not used in real life yet. |
I'm closing this. It should be fixed by the authentication-plugin, not by RxDB. |
@barbalex have you found a workaround? |
@servocoder nope, sadly not. I'm waiting for pouchdb and the authentication-plugin to solve it. |
I've been able to work around this, not by setting collection.sync({
options: {
fetch: (url, opts) => PouchDb.fetch(url, {
...opts,
credentials: 'include',
})
},
}) |
Case
This is an issue in PouchDB and https://github.com/pouchdb-community/pouchdb-authentication that raises issues for people using rxdb.
I am raising this here to inform others that may run into this.
There is a workaround described here: pouchdb-community/pouchdb-authentication#239 (comment) that could maybe be applied to rxdb for as long as the issues in PouchDB and pouchdb-authentication are not resolved.
Related issues:
Issue
Authorization using cookies does not work.
Info
Code
this sync:
results in:
http://localhost:5984/user_test_at_test_p_ch/ 401 (Unauthorized)
after logging in:
The text was updated successfully, but these errors were encountered: