{"action":"created","issue":{"url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication/issues/132","repository_url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication","labels_url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication/issues/132/labels{/name}","comments_url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication/issues/132/comments","events_url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication/issues/132/events","html_url":"https://github.com/nolanlawson/pouchdb-authentication/issues/132","id":197396194,"number":132,"title":"Signup not working, \"Authentication Required\"","user":{"login":"blast1987","id":2203551,"avatar_url":"https://avatars.githubusercontent.com/u/2203551?v=3","gravatar_id":"","url":"https://api.github.com/users/blast1987","html_url":"https://github.com/blast1987","followers_url":"https://api.github.com/users/blast1987/followers","following_url":"https://api.github.com/users/blast1987/following{/other_user}","gists_url":"https://api.github.com/users/blast1987/gists{/gist_id}","starred_url":"https://api.github.com/users/blast1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blast1987/subscriptions","organizations_url":"https://api.github.com/users/blast1987/orgs","repos_url":"https://api.github.com/users/blast1987/repos","events_url":"https://api.github.com/users/blast1987/events{/privacy}","received_events_url":"https://api.github.com/users/blast1987/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-23T16:28:54Z","updated_at":"2016-12-28T17:36:03Z","closed_at":"2016-12-28T17:35:00Z","body":"Hello, i've followed your tutorial looks like i've configured couchdb server correctly. but with signup method i'm still getting \"authentication required\".\r\n\r\nMy code:\r\n\r\n\r\n`var remoteDB = new PouchDB(\"http://127.0.0.1:5984/db\", {skipSetup: true});`\r\n\r\n\r\n`$scope.signup = function() {\r\n        remoteDB.signup($scope.loginData.username, $scope.loginData.password, function (err, response) {\r\n        if (err) {\r\n            if (err.name === 'conflict') {\r\n                alert('User exists!');\r\n            } else if (err.name === 'forbidden') {\r\n                alert('Invalid user!');\r\n            } else {\r\n                alert('Error!');\r\n            }\r\n        }\r\n    });\r\n  }`\r\n\r\nCouchDb version is 1.6.1"},"comment":{"url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication/issues/comments/269511284","html_url":"https://github.com/nolanlawson/pouchdb-authentication/issues/132#issuecomment-269511284","issue_url":"https://api.github.com/repos/nolanlawson/pouchdb-authentication/issues/132","id":269511284,"user":{"login":"blast1987","id":2203551,"avatar_url":"https://avatars.githubusercontent.com/u/2203551?v=3","gravatar_id":"","url":"https://api.github.com/users/blast1987","html_url":"https://github.com/blast1987","followers_url":"https://api.github.com/users/blast1987/followers","following_url":"https://api.github.com/users/blast1987/following{/other_user}","gists_url":"https://api.github.com/users/blast1987/gists{/gist_id}","starred_url":"https://api.github.com/users/blast1987/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blast1987/subscriptions","organizations_url":"https://api.github.com/users/blast1987/orgs","repos_url":"https://api.github.com/users/blast1987/repos","events_url":"https://api.github.com/users/blast1987/events{/privacy}","received_events_url":"https://api.github.com/users/blast1987/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T17:36:03Z","updated_at":"2016-12-28T17:36:03Z","body":"closed, correct way of doing this is \r\n\r\n`var ajaxOpts = {\r\n  ajax: {\r\n    headers: {\r\n      Authorization: 'Basic ' + window.btoa(user.name + ':' + user.password)\r\n    }     \r\n  }\r\n  \r\n};\r\n\r\nloginDB.login($scope.loginData.username, $scope.loginData.password, ajaxOpts,function (err, response) {\r\n        if (err) {\r\n            if (err.name === 'unauthorized') {\r\n                alert('User or pass incorrect!');\r\n            } else {\r\n                alert('Error!');\r\n            }\r\n        } else {\r\n                alert('Logged in ' + $scope.loginData.username);\r\n            }\r\n        });\r\n`"}}
{"actor":{"display_login":"blast1987"}}