Skip to content

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

@BrandonCopley

Description

@BrandonCopley

[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions