{"action":"created","issue":{"url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/25","labels_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/25/comments","events_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/25/events","html_url":"https://github.com/joegoldbeck/mongoose-encryption/issues/25","id":104323320,"number":25,"title":"Error: Authentication code missing","user":{"login":"globlee","id":10442269,"avatar_url":"https://avatars.githubusercontent.com/u/10442269?v=3","gravatar_id":"","url":"https://api.github.com/users/globlee","html_url":"https://github.com/globlee","followers_url":"https://api.github.com/users/globlee/followers","following_url":"https://api.github.com/users/globlee/following{/other_user}","gists_url":"https://api.github.com/users/globlee/gists{/gist_id}","starred_url":"https://api.github.com/users/globlee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/globlee/subscriptions","organizations_url":"https://api.github.com/users/globlee/orgs","repos_url":"https://api.github.com/users/globlee/repos","events_url":"https://api.github.com/users/globlee/events{/privacy}","received_events_url":"https://api.github.com/users/globlee/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-01T18:07:45Z","updated_at":"2015-09-01T18:28:38Z","closed_at":"2015-09-01T18:14:20Z","body":"I get the error: \"Error: Authentication code missing\" after doing a schema.findone\r\n\r\nApparently this is an error with signing\r\n\r\nMy code is extremely basic, just two lines and I have checked it about 25 times to make sure it matches the example\r\nI have tried with the secret string, with the codes, with encrypted fields and without (full document).\r\nexample:\r\n\r\nvar secret = \"1WqEMNO7vdp4CY3YPzE4dL3tnng1ZfjeziBXibPecOgL7SnEdUWaqoyGCyoozAAZOwajkIJt0UL5cdQiHV18EEzhSNn2OtW8JTlpjOYxwB3C21PV4ODXgF1YQ0oH9A\";\r\n\r\nUserSchema.plugin(encrypt, { secret: secret});\r\n\r\nAre there any common reasons for this error, or can you tell me more about what _ac is so I can try to figure out whats wrong here?\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/comments/136820724","html_url":"https://github.com/joegoldbeck/mongoose-encryption/issues/25#issuecomment-136820724","issue_url":"https://api.github.com/repos/joegoldbeck/mongoose-encryption/issues/25","id":136820724,"user":{"login":"joegoldbeck","id":2604712,"avatar_url":"https://avatars.githubusercontent.com/u/2604712?v=3","gravatar_id":"","url":"https://api.github.com/users/joegoldbeck","html_url":"https://github.com/joegoldbeck","followers_url":"https://api.github.com/users/joegoldbeck/followers","following_url":"https://api.github.com/users/joegoldbeck/following{/other_user}","gists_url":"https://api.github.com/users/joegoldbeck/gists{/gist_id}","starred_url":"https://api.github.com/users/joegoldbeck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joegoldbeck/subscriptions","organizations_url":"https://api.github.com/users/joegoldbeck/orgs","repos_url":"https://api.github.com/users/joegoldbeck/repos","events_url":"https://api.github.com/users/joegoldbeck/events{/privacy}","received_events_url":"https://api.github.com/users/joegoldbeck/received_events","type":"User","site_admin":false},"created_at":"2015-09-01T18:28:38Z","updated_at":"2015-09-01T18:28:38Z","body":"Yup! Alternatively you can migrate your existing collection with `#migrateToA`. https://github.com/joegoldbeck/mongoose-encryption/tree/7a71d633958688f86823bc790d3817bea2c0a774#getting-started-with-an-existing-collection which will sign and encrypt all the documents\r\n\r\nBe sure to backup your database first!"}}