Skip to content
Snippets Groups Projects
Commit e7200a84 authored by Wilson JALLET's avatar Wilson JALLET :money_with_wings:
Browse files

Fallback to local ldap connexion config when can't find user session

parent 8a8ae205
No related branches found
No related tags found
No related merge requests found
......@@ -73,6 +73,8 @@ server.use('/assets',express.static(path.resolve('./','assets')));
// Morgan is middleware for logging requests
server.use(morgan('dev'));
const defaultUser = require('../ldap_connexion_config.json');
// Charge le middleware express pour GraphQL
server.use('/graphql', bodyParser.json(), cors(),
graphqlExpress(req => {
......@@ -83,8 +85,9 @@ server.use('/graphql', bodyParser.json(), cors(),
uid = req.session.passport.user.uid;
password = "mythe";
} catch (err) {
uid = "quentin.chevalier";
password = "";
uid = defaultUser.dn.split("=")[1].split(",")[0];
console.log(uid);
password = defaultUser.passwd;
}
console.log("Accessing GraphQL as:",uid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment