Disabling completely routes if admin token not configured
This commit is contained in:
parent
767ac9a68f
commit
12d6d9a50d
7 changed files with 22 additions and 5 deletions
|
@ -15,6 +15,9 @@ export class DebugController {
|
|||
(async () => {
|
||||
const query = parse(req.getQuery());
|
||||
|
||||
if (ADMIN_API_TOKEN === "") {
|
||||
return res.writeStatus("401 Unauthorized").end("No token configured!");
|
||||
}
|
||||
if (query.token !== ADMIN_API_TOKEN) {
|
||||
return res.writeStatus("401 Unauthorized").end("Invalid token sent!");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue