1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.useGrab = useGrab;
|
7 |
|
8 | var _bodyParser = require('body-parser');
|
9 |
|
10 | var _bodyParser2 = _interopRequireDefault(_bodyParser);
|
11 |
|
12 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13 |
|
14 | function useGrab(app, config) {
|
15 |
|
16 | var email = config.email,
|
17 | localAuthenticate = config.localAuthenticate,
|
18 | jwtAuthenticate = config.jwtAuthenticate,
|
19 | password = config.password,
|
20 | routePath = config.routePath,
|
21 | transactionsRouter = config.transactionsRouter;
|
22 |
|
23 |
|
24 | app.use(_bodyParser2.default.json());
|
25 |
|
26 | var authBody = { email: email,
|
27 | isJwtNext: true,
|
28 | password: password
|
29 |
|
30 | };app.use(routePath, function (req, res, next) {
|
31 | Object.assign(req.body, authBody);
|
32 | next();
|
33 | }, localAuthenticate, jwtAuthenticate, transactionsRouter);
|
34 | } |
\ | No newline at end of file |