Skip to content
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

signOut: do not show "You are not authorized to access this db." error #262

Closed
gr2m opened this issue Mar 9, 2014 · 3 comments
Closed

Comments

@gr2m
Copy link
Member

gr2m commented Mar 9, 2014

To reproduce

  1. Sign in to an account
  2. In a second tab, sign out
  3. Make a change, so that hoodie.store.hasLocalChanges() returns true
  4. hoodie.account.signOut().fail( showError )

showError gets called with

{
  "name": "HoodieUnauthorizedError",
  "status": 401,
  "message": "You are not authorized to access this db."
}

The error should be something more generic instead. What happens in the background is that hoodie pushes local changes to remote in case there are any, so no data gets lost. And if there are changes and the push does not succeed, the signOut gets rejected. I don't know what the best error message would be to concisely explain the problem to the user.

As a side note, you can call signOut({ignoreLocalChanges: true}) to prevent that error from popping up, but that also means that eventual local changes get lost.

@gr2m gr2m added the bug label Mar 9, 2014
@svnlto svnlto added the starter label Mar 12, 2014
@lewiscowper
Copy link

Is this changing the error message in a general way for the HoodieUnauthorizedError? Or is there call to modify the error call for hoodie.account.signOut().fail( showError ) instead? Is the db message needing to still be there for other cases?

@gr2m
Copy link
Member Author

gr2m commented Mar 15, 2014

yes that message would make sense if you try to access a database that you are not allowed to, e.g. via hoodie.open("dbname").findAll(). It's a special case here. What we really need to do is to ask the user to authenticate in order to push all local changes before the signout will be completed. Alternatively the user ignores that and accepts that data gets lost.

So the error should be saying something like "You have local changes but your session is invalid, please reauthenticate". Maybe you have a better wording idea, I'm not native English speaking

@gr2m
Copy link
Member Author

gr2m commented May 7, 2016

closing in favor of hoodiehq/hoodie-account-client#91

@gr2m gr2m closed this as completed May 7, 2016
@gr2m gr2m removed the later label May 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants