mongoose-auth icon indicating copy to clipboard operation
mongoose-auth copied to clipboard

lib / modules / password / index.js note

Open blakmatrix opened this issue 13 years ago • 2 comments

In the following code, if some one was to use loginWith: login the code needlessly calls delete schema.login;. In another note should we absolutely be confined to value being of type String?

Object.defineProperty(exports, 'specialOptHandlers', {
    value: {
        loginWith: function (value) {
          if (value) {
            delete schema.login;
            schema[value] = { type: String, unique: true };
            everyauth.password.loginWith(value);
          }
        }...

blakmatrix avatar Aug 20 '11 08:08 blakmatrix

What would you use instead of String?

bnoguchi avatar Aug 21 '11 20:08 bnoguchi

Well, most types can be flattened to a String, I guess I was looking too far forward.

blakmatrix avatar Aug 21 '11 21:08 blakmatrix