{"action":"created","issue":{"url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication/issues/82","repository_url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication","labels_url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication/issues/82/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication/issues/82/comments","events_url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication/issues/82/events","html_url":"https://github.com/pouchdb-community/pouchdb-authentication/issues/82","id":143860133,"number":82,"title":"'denied' error during sync if user's session has expired","user":{"login":"Anyante","id":16100713,"avatar_url":"https://avatars2.githubusercontent.com/u/16100713?v=3","gravatar_id":"","url":"https://api.github.com/users/Anyante","html_url":"https://github.com/Anyante","followers_url":"https://api.github.com/users/Anyante/followers","following_url":"https://api.github.com/users/Anyante/following{/other_user}","gists_url":"https://api.github.com/users/Anyante/gists{/gist_id}","starred_url":"https://api.github.com/users/Anyante/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anyante/subscriptions","organizations_url":"https://api.github.com/users/Anyante/orgs","repos_url":"https://api.github.com/users/Anyante/repos","events_url":"https://api.github.com/users/Anyante/events{/privacy}","received_events_url":"https://api.github.com/users/Anyante/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-03-27T23:19:26Z","updated_at":"2017-05-25T18:46:50Z","closed_at":"2016-03-29T06:08:32Z","body":"Hi all\n\nMy scenario is similar to the Twitter example (\"Everybody can read, only some can write (some things\").\nI've created a validate_doc_update function (remote DB) to enforce that users only can modify their own documents.\n\nEverything is working smoothly now - as long as the user is logged in / online (e.g. the auth cookie exists).\n\nUnfortunately, I'm not sure how to handle the offline / session expired scenario correctly.\nA user is able to save a doc (to the local DB) even if he's offline/not logged in (auth cookie expired).\n\nAs soon as the browser is online again, the remote DB returns a 'denied' error for that document. This is correct at that moment because the user is not logged in (auth cookie expired).\nHowever, the document never gets pushed to the remote DB.\n\nHow should I handle this? \"retry\" a (full?) replication after the user has logged in again?\nHandle the 'denied' event somehow?\n\nRegards,\nAnyante\n"},"comment":{"url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication/issues/comments/304091308","html_url":"https://github.com/pouchdb-community/pouchdb-authentication/issues/82#issuecomment-304091308","issue_url":"https://api.github.com/repos/pouchdb-community/pouchdb-authentication/issues/82","id":304091308,"user":{"login":"alejandro-heredia-coderoad-com","id":19911943,"avatar_url":"https://avatars3.githubusercontent.com/u/19911943?v=3","gravatar_id":"","url":"https://api.github.com/users/alejandro-heredia-coderoad-com","html_url":"https://github.com/alejandro-heredia-coderoad-com","followers_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/followers","following_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/following{/other_user}","gists_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/gists{/gist_id}","starred_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/subscriptions","organizations_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/orgs","repos_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/repos","events_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/events{/privacy}","received_events_url":"https://api.github.com/users/alejandro-heredia-coderoad-com/received_events","type":"User","site_admin":false},"created_at":"2017-05-25T18:46:50Z","updated_at":"2017-05-25T18:46:50Z","body":"Using pouchdb-authentication on an Ionic 1.3.2 hybrid application. I get a similar error when the device is on **standby** until session expires. Then when the devices **resumes** I handle a re-authentication."}}
{"actor":{"display_login":"alejandro-heredia-coderoad-com"}}