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

When used with passport-local-mongoose and mongoDB 3.0 we get this issue #29

Open
BrandonCopley opened this issue Aug 21, 2015 · 1 comment

Comments

@BrandonCopley
Copy link

[TypeError: Cannot assign to read only property 'checkKeys' of true]

passport-local-mongoose 1.0.1
timestamps 0.4.0

var mongoose = require('mongoose');
var passportLocalMongoose = require('passport-local-mongoose');
var timestamps = require('mongoose-timestamp');

var Schema = mongoose.Schema;

exports.User = mongoose.model('User', new Schema({
  username: {
    type: String,
    index: {
      unique: true,
      sparse: true
    }
  },
  email: String
}, {
  safe: true,
  strict: true
}).plugin(passportLocalMongoose, {}).plugin(timestamps));

removing the timestamps plugin gets this working, but I liked the timestamps plugin.

@BrandonCopley
Copy link
Author

I've narrowed this down to something with strict:true turned on causing issues in other code of mine, is this perhaps being used here?

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

No branches or pull requests

1 participant