Local auth seems to work
This commit is contained in:
parent
d79bbad575
commit
9758b4b104
34 changed files with 199 additions and 141 deletions
|
@ -53,11 +53,14 @@ module.exports.restLogout = (req, res) => {
|
|||
|
||||
module.exports.restLogin = (req, res, next) => {
|
||||
passport.authenticate(config.ldap.enabled ? 'ldap' : 'local', (err, user, info) => {
|
||||
return next(err);
|
||||
if (err) {
|
||||
return next(err);
|
||||
}
|
||||
|
||||
if (!user) {
|
||||
return next(new interoperableErrors.IncorrectPasswordError());
|
||||
}
|
||||
|
||||
req.logIn(user, err => {
|
||||
if (err) {
|
||||
return next(err);
|
||||
|
@ -79,7 +82,7 @@ module.exports.restLogin = (req, res, next) => {
|
|||
if (config.ldap.enabled && LdapStrategy) {
|
||||
log.info('Using LDAP auth');
|
||||
module.exports.authMethod = 'ldap';
|
||||
module.exports.isAuthMethodLocal = false;
|
||||
module.exports.isAuthMethodLocal = true;
|
||||
|
||||
let opts = {
|
||||
server: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue