api/core: move ratelimiters before authentication handler
This commit is contained in:
parent
3317726afe
commit
57c9836f56
1 changed files with 3 additions and 3 deletions
|
@ -102,6 +102,9 @@ export const runAPI = (express, app, __dirname) => {
|
|||
...corsConfig,
|
||||
}));
|
||||
|
||||
app.post('/', apiLimiter);
|
||||
app.use('/tunnel', apiLimiterStream);
|
||||
|
||||
app.post('/', (req, res, next) => {
|
||||
if (!env.turnstileSecret || !env.jwtSecret) {
|
||||
return next();
|
||||
|
@ -140,9 +143,6 @@ export const runAPI = (express, app, __dirname) => {
|
|||
next();
|
||||
});
|
||||
|
||||
app.post('/', apiLimiter);
|
||||
app.use('/tunnel', apiLimiterStream);
|
||||
|
||||
app.use('/', express.json({ limit: 1024 }));
|
||||
app.use('/', (err, _, res, next) => {
|
||||
if (err) {
|
||||
|
|
Loading…
Reference in a new issue