Feature/delay middleware (#146)

* add delay middleware to login and signin routes

* Different delay for sendStatus and json

---------

Co-authored-by: Markus Frindt <m.frindt@cognigy.com>
This commit is contained in:
Markus FrindtandMarkus Frindt authored and GitHub committed 2023-04-06 08:25:45 -04:00
1 parent 84305e30cc
commit 009396becc
2 files changed
+34

No files matched your search

+2
View File
@@ -64,6 +64,7 @@ const {
}, logger);
const PORT = process.env.HTTP_PORT || 3000;
const authStrategy = require('./lib/auth')(logger, retrieveKey);
const {delayLoginMiddleware} = require('./lib/middleware');
passport.use(authStrategy);
@@ -129,6 +130,7 @@ app.use(nocache());
app.use(passport.initialize());
app.use(cors());
app.use(express.urlencoded({extended: true}));
app.use(delayLoginMiddleware);
app.use(unless(['/stripe'], express.json()));
app.use('/v1', unless(
[