1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/lib/middleware/no-authentication.js
Ivar Conradi Østhus 0907d4749f
fix: none authentication should have a mock user (#449)
This also fix the bug introduces where authentication mode triggers readOnly mode in the UI.
2019-06-08 12:50:59 +02:00

13 lines
283 B
JavaScript

'use strict';
const User = require('../user');
function noneAuthentication(basePath = '', app) {
app.use(`${basePath}/api/admin/`, (req, res, next) => {
req.user = new User({ email: 'none@unknown.com' });
next();
});
}
module.exports = noneAuthentication;