We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2959acd commit 5090429Copy full SHA for 5090429
1 file changed
src/server/api.js
@@ -128,14 +128,14 @@ export const createApiServer = ({ db, games }) => {
128
// If API_SECRET is set, then require that requests set an
129
// api-secret header that is set to the same value.
130
app.use(async (ctx, next) => {
131
- await next();
132
-
133
if (
134
!!process.env.API_SECRET &&
135
ctx.request.headers['api-secret'] !== process.env.API_SECRET
136
) {
137
ctx.throw(403, 'Invalid API secret');
138
}
+
+ await next();
139
});
140
141
app.use(router.routes()).use(router.allowedMethods());
0 commit comments