Ensure that the login account should be locked after N number of attempts. N is configurable using the 'MAX_LOGIN_ATTEMPTS' parameter. Fixes #6337

This commit is contained in:
Florian Sabonchi
2021-07-22 12:24:43 +05:30
committed by Akshay Joshi
parent c2db647379
commit a3d3c74e67
8 changed files with 113 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ import uuid
#
##########################################################################
SCHEMA_VERSION = 30
SCHEMA_VERSION = 31
##########################################################################
#
@@ -80,6 +80,8 @@ class User(db.Model, UserMixin):
# fs_uniquifier is required by flask-security-too >= 4.
fs_uniquifier = db.Column(db.String(255), unique=True, nullable=False,
default=(lambda _: uuid.uuid4().hex))
login_attempts = db.Column(db.Integer, default=0)
locked = db.Column(db.Boolean(), default=False)
class Setting(db.Model):