Only adding info on where to get api-token if not authorized with an api-token

This commit is contained in:
Kasper Rynning-Tønnesen
2018-10-02 15:10:08 +02:00
parent 7ca8d91a0e
commit b802a0af3d

View File

@@ -63,7 +63,7 @@ var error = {
},
tooMany: {
status: 429,
error: "You're doing too many requests, check header-field Retry-After for the wait-time left. To get an API-key, visit https://zoff.me/api/apply",
error: "You're doing too many requests, check header-field Retry-After for the wait-time left.",
success: false,
results: [],
},
@@ -1405,6 +1405,7 @@ function checkTimeout(guid, res, authorized, type, callback) {
var retry_in = (date.getTime() - now.getTime()) / 1000;
if(retry_in > 0) {
res.header({'Retry-After': retry_in});
error.tooMany.error += " To get an API-key, visit https://zoff.me/api/apply.";
res.status(429).send(error.tooMany);
return;
}