mirror of
https://github.com/wekan/wekan.git
synced 2025-09-22 01:50:48 +02:00

Added filtering of Admin Panel/People/People: All Users/Locked Users Only/Active/Not Active. Added visual indicators: red lock icon for locked users, green check for active users, and red X for inactive users. Added "Unlock All" button to quickly unlock all brute force locked users. Added ability to toggle user active status directly from the People page. Moved lockout settings from environment variables to database so admins can configure the lockout thresholds directly in the UI. Thanks to xet7.
33 lines
1.3 KiB
JavaScript
33 lines
1.3 KiB
JavaScript
import { AccountsLockout } from 'meteor/wekan-accounts-lockout';
|
|
import LockoutSettings from '/models/lockoutSettings';
|
|
|
|
Meteor.startup(() => {
|
|
// Wait for the database to be ready
|
|
Meteor.setTimeout(() => {
|
|
try {
|
|
// Get configurations from database
|
|
const knownUsersConfig = {
|
|
failuresBeforeLockout: LockoutSettings.findOne('known-failuresBeforeLockout')?.value || 3,
|
|
lockoutPeriod: LockoutSettings.findOne('known-lockoutPeriod')?.value || 60,
|
|
failureWindow: LockoutSettings.findOne('known-failureWindow')?.value || 15
|
|
};
|
|
|
|
const unknownUsersConfig = {
|
|
failuresBeforeLockout: LockoutSettings.findOne('unknown-failuresBeforeLockout')?.value || 3,
|
|
lockoutPeriod: LockoutSettings.findOne('unknown-lockoutPeriod')?.value || 60,
|
|
failureWindow: LockoutSettings.findOne('unknown-failureWindow')?.value || 15
|
|
};
|
|
|
|
// Initialize the AccountsLockout with configuration
|
|
const accountsLockout = new AccountsLockout({
|
|
knownUsers: knownUsersConfig,
|
|
unknownUsers: unknownUsersConfig,
|
|
});
|
|
|
|
// Start the accounts lockout mechanism
|
|
accountsLockout.startup();
|
|
} catch (error) {
|
|
console.error('Failed to initialize accounts lockout:', error);
|
|
}
|
|
}, 2000); // Small delay to ensure database is ready
|
|
});
|