Answer the question
In order to leave comments, you need to log in
Why can a query to MongoDB through Mongoose hang?
AccessToken - Mongoose Model
var mongoose = require('mongoose');
var Schema = mongoose.Schema;
// AccessToken
var AccessToken = new Schema({
userId: {
type: String,
required: true
},
clientId: {
type: String,
required: true
},
token: {
type: String,
unique: true,
required: true
},
created: {
type: Date,
default: Date.now
}
});
module.exports = mongoose.model('AccessToken', AccessToken);
passport.use(
new BearerStrategy(
function( accessToken, done ) {
// Здесь в консоль нормально выводится accessToken и done
AccessToken.findOne( { token: accessToken }, function( err, token ) {
// До этой точки не доходит - ЗАВИСАЕТ
}
}
)
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question