couchbaselabs/ToDoLite-Android

Code needs to use facebook user id instead of email in profile doc id

tleyden opened this issue · 0 comments

Due to couchbase/sync_gateway#580

Getting this error on todolite ios:

12:13:12.206‖ WARNING: CBL_Pusher[http://localhost:4984/todos]: _bulk_docs got an error: {
    error = forbidden;
    id = "p:mistersweets@gmail.com";
    reason = "wrong user";
    status = 403;
}

The problem is that requireUser() expects the facebook ID, since after the PR, the user doc in couchbase server is:

doc id : _sync:user:1378769115762233
{
  "name": "1378769115762233",
  "all_channels": {
    "!": 1
  },
  "sequence": 0,
  "email": "mistersweets@gmail.com",
  "passwordhash_bcrypt": "JDJhJDEwJC9wTDNFY1ZPclVLZUt2NERjOHVQZU9ZL3h4V3kxUHhEU1JqeGFpSGFWeDFuTFFrLmF1Sk5t",
  "rolesSince": {}
}

Need to change:

  • profile doc id
  • user id

to be the facebook user id rather than the email.

Also, to make debugging easier, we should add a new field to the profile document to hold the email address, since after the above changes the profile doc will no longer have email anywhere else.