Skip to content

Instantly share code, notes, and snippets.

@csanz
Created May 3, 2011 22:02
Show Gist options
  • Select an option

  • Save csanz/954359 to your computer and use it in GitHub Desktop.

Select an option

Save csanz/954359 to your computer and use it in GitHub Desktop.
Yo Brian -
Re: https://github.com/bnoguchi/mongoose-auth/blob/master/lib/modules/password/everyauth.js#L6-8
What do you think about something more like this for the error handling:
validation fields
/models/user/validation.js
{
"name":
{
"missing" : 1,
"size" : "<100"
},
"email":
{
"missing" : 1,
"match" : "(.*)@(.*)\.(com|net)"
}
That way you can configure any fields inside your model. Perhaps keep this close to the schema file of the object.
Thoughts?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment