mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
parent
4403a00651
commit
0f3cc3196c
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user