fixed db requirements in passport files
This commit is contained in:
parent
532702c095
commit
00a3e9be23
6 changed files with 124 additions and 126 deletions
2
index.js
2
index.js
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,8 @@
|
||||||
const PassportLocalStrategy = require('passport-local').Strategy;
|
const PassportLocalStrategy = require('passport-local').Strategy;
|
||||||
const logger = require('winston');
|
const logger = require('winston');
|
||||||
|
const db = require('../models');
|
||||||
|
|
||||||
module.exports = (db) => {
|
const returnUserAndChannelInfo = (userInstance) => {
|
||||||
const returnUserAndChannelInfo = (userInstance) => {
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let userInfo = {};
|
let userInfo = {};
|
||||||
userInfo['id'] = userInstance.id;
|
userInfo['id'] = userInstance.id;
|
||||||
|
@ -22,9 +22,9 @@ module.exports = (db) => {
|
||||||
reject(error);
|
reject(error);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
return new PassportLocalStrategy(
|
module.exports = new PassportLocalStrategy(
|
||||||
{
|
{
|
||||||
usernameField: 'username',
|
usernameField: 'username',
|
||||||
passwordField: 'password',
|
passwordField: 'password',
|
||||||
|
@ -62,5 +62,4 @@ module.exports = (db) => {
|
||||||
return done(error);
|
return done(error);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
const PassportLocalStrategy = require('passport-local').Strategy;
|
const PassportLocalStrategy = require('passport-local').Strategy;
|
||||||
const lbryApi = require('../helpers/lbryApi.js');
|
const lbryApi = require('../helpers/lbryApi.js');
|
||||||
const logger = require('winston');
|
const logger = require('winston');
|
||||||
|
const db = require('../models');
|
||||||
|
|
||||||
module.exports = (db) => {
|
module.exports = new PassportLocalStrategy(
|
||||||
return new PassportLocalStrategy(
|
|
||||||
{
|
{
|
||||||
usernameField: 'username',
|
usernameField: 'username',
|
||||||
passwordField: 'password',
|
passwordField: 'password',
|
||||||
|
@ -61,5 +61,4 @@ module.exports = (db) => {
|
||||||
return done(error);
|
return done(error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Loading…
Add table
Reference in a new issue