Quitar autenticacion del endpoint POST /token

El endpoint queda abierto para que cualquier servicio local pueda
solicitar tokens sin necesitar el SERVER_TOKEN.
This commit is contained in:
2026-02-14 15:48:58 -06:00
parent 64da2eacc5
commit 870207f151
3 changed files with 2 additions and 20 deletions

View File

@@ -25582,14 +25582,6 @@ var httpServer = createServer(async (req, res) => {
const url2 = new URL(`http://${HOST}${req.url}`);
if (url2.pathname === "/token" && req.method === "POST") {
try {
if (serverToken) {
const authHeader = req.headers.authorization;
if (authHeader !== `Bearer ${serverToken}`) {
res.writeHead(401, { "Content-Type": "application/json" });
res.end(JSON.stringify({ error: "Unauthorized" }));
return;
}
}
const token = await generateNewRegistrationToken();
res.writeHead(200, { "Content-Type": "application/json" });
res.end(JSON.stringify({

File diff suppressed because one or more lines are too long