Fix bug saving GitHub tokens from other servers
This fixes a bug introduced in 076cb14, wherein we discarded tokens received
from other servers, and wherein we could save tokens with invalid
identification.
The bug was raised by Paul Melnikow.
This commit is contained in:
@@ -104,9 +104,9 @@ function setRoutes(server) {
|
||||
});
|
||||
|
||||
server.route(/^\/github-auth\/add-token$/, function(data, match, end, ask) {
|
||||
if (constEq(data.shieldsSecret, serverSecrets.shieldsSecret)) {
|
||||
// An unknown entity tries to connect. Let the connection linger for a minute.
|
||||
return setTimeout(function() { end('Invalid secret.'); }, 60000);
|
||||
if (!constEq(data.shieldsSecret, serverSecrets.shieldsSecret)) {
|
||||
// An unknown entity tries to connect. Let the connection linger for 10s.
|
||||
return setTimeout(function() { end('Invalid secret.'); }, 10000);
|
||||
}
|
||||
addGithubToken(data.token);
|
||||
end('Thanks!');
|
||||
|
||||
Reference in New Issue
Block a user