Closed MattCed closed 8 years ago
Workaround. If I reload the page with location.reload() after signing in with a new user hoodie start to use the correct URL, but it is not a very elegant solution.
@MattCed the problem here is not that you sign out and back into the same account, but you sign out, signup for a new account, sign in to the new account, and it wrongly tries connects to the database of the first user, right?
Yes, That is correct. And after that the wrong backend URL is used every time I switch account. When that happens it is not possible to signOut anymore. If I restart the app I am automatically logged in again though and it works fine until I switch account again.
Thanks a lot, I’ll have a look into it!
This issue was resolved via https://github.com/hoodiehq/hoodie-store-client/releases/tag/v5.0.3. Can you update to the latest hoodie? Version 23.3.0 or above should work, the latest is v23.3.3. If the error still persists, try to rm .hoodie/client.js
to delete the cached hoodie client, but it should do that automatically if it detects updated dependencies
Thanks a lot. I actually used 23.3.3, or rather I thought i did, but when I went into reset.js I noticed that the reset() function was the old one. What happened was that I changed the name of my main project directory in June, but some of the package.json files in node_modules/@hoodie... contained absolute paths so the files were not updated in the correct place. So according to npm I was using 23.3.3, but I really was not. (Note to self: Don't change directory names :-) )
Glad we figured it out :)
I have an application with several users on the same device, using couchDB as database. When i signOut from one account and then signIn with another, hoodie tries to use a URL associated with the first account to fetch data, thus resulting in an authentication error. I have isolated the problem by writing some console commands as follows: (I tried the same with a new application using only Pouch and then the error does not occur)
xhRequest @ client.js:21135ajax$1 @ client.js:21154ajaxCore @ client.js:21248ajax @ client.js:21305ajax$$ @ client.js:21454(anonymous function) @ client.js:21459ajaxPromise @ client.js:21458setup @ client.js:21495(anonymous function) @ client.js:21470(anonymous function) @ client.js:2467(anonymous function) @ client.js:14132(anonymous function) @ client.js:2467(anonymous function) @ client.js:14069(anonymous function) @ client.js:14056(anonymous function) @ client.js:2467(anonymous function) @ client.js:14127TaskQueue.execute @ client.js:16541TaskQueue.ready @ client.js:16554(anonymous function) @ client.js:16724(anonymous function) @ client.js:21521 client.js:21135 GET http://192.168.1.11:8080/hoodie/store/api/user%2Fanew2o3/ 401 (Unauthorized)xhRequest @ client.js:21135ajax$1 @ client.js:21154ajaxCore @ client.js:21248ajax @ client.js:21305ajax$$ @ client.js:21454(anonymous function) @ client.js:21459ajaxPromise @ client.js:21458setup @ client.js:21495(anonymous function) @ client.js:21470(anonymous function) @ client.js:2467(anonymous function) @ client.js:14132(anonymous function) @ client.js:2467(anonymous function) @ client.js:14069(anonymous function) @ client.js:14056(anonymous function) @ client.js:2469generateReplicationId @ client.js:23853initCheckpointer @ client.js:23908startChanges @ client.js:24234replicate$1 @ client.js:24303(anonymous function) @ client.js:24120