Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(neo4jConnection, {secret, passwordMatches, tokenExpirationInterval,
userCypherQueryFile, rolesCypherQueryFile} = {}) {
this.neo4jConnection = neo4jConnection;
this.passport = new KoaPassport();
this.secret = secret;
this.passwordMatches = passwordMatches;
this.tokenExpirationInterval = tokenExpirationInterval || '1h';
this.userQuery = userCypherQueryFile;
this.rolesQuery = rolesCypherQueryFile;
this.passport.use(
new LocalStrategy((username, password, done) => this.getUser(username, password)
.then(user => done(null, user))
.catch(done))
);
// koa-passport uses generators which will be deprecated in koa v3,
// below block should be refactored accordingly
// The author of koa-passport has not considered the use cases of done(err),