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

add putUser() to update user metadata #89

Merged
merged 1 commit into from
May 2, 2016

Conversation

jgillich
Copy link
Contributor

No description provided.

@nolanlawson
Copy link
Member

Looks like a great PR! I will look it over and merge soon.

if (opts.metadata) {
for (var key in opts.metadata) {
if (opts.hasOwnProperty(key)) {
if (reservedWords.indexOf(key) !== -1 || key.startsWith('_')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is obvious to couchdb pro's but being a noob - it would be helpful to have 2 error messages here...

Possibly

if (reservedWords.indexOf(key) !== -1) {
  return callback(new AuthError('Cannot use reserved word in metadata: "' + key + '"'));
}
if (key.startsWith('_')) {
  return callback(new AuthError('Cannot have metadata key start with an _ as seen on key: "' + key + '"'));
}

Thoughts?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, maybe? But that could be done in another PR.

@nolanlawson nolanlawson merged commit c2dddd1 into pouchdb-community:master May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants