1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

Log-in window incorrect

fixes #583
This commit is contained in:
Nick O'Leary 2015-03-09 20:01:29 +00:00
parent 4403a00651
commit 0f3cc3196c

View File

@ -55,13 +55,13 @@ var clientPasswordStrategy = function(clientId, clientSecret, done) {
clientPasswordStrategy.ClientPasswordStrategy = new ClientPasswordStrategy(clientPasswordStrategy); clientPasswordStrategy.ClientPasswordStrategy = new ClientPasswordStrategy(clientPasswordStrategy);
var loginAttempts = []; var loginAttempts = [];
var loginSignUpWindow = 36000000; // 10 minutes var loginSignInWindow = 600000; // 10 minutes
var passwordTokenExchange = function(client, username, password, scope, done) { var passwordTokenExchange = function(client, username, password, scope, done) {
var now = Date.now(); var now = Date.now();
loginAttempts = loginAttempts.filter(function(logEntry) { loginAttempts = loginAttempts.filter(function(logEntry) {
return logEntry.time + loginSignUpWindow > now; return logEntry.time + loginSignInWindow > now;
}); });
loginAttempts.push({time:now, user:username}); loginAttempts.push({time:now, user:username});
var attemptCount = 0; var attemptCount = 0;