Add LDAP Aunthentication

This commit is contained in:
2026-08-06 18:17:33 +05:30
parent e7805b71a8
commit b380ed510b
11 changed files with 169 additions and 225 deletions

View File

@@ -7,10 +7,13 @@ class User(db.Model):
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.String(200), nullable=False)
email = db.Column(db.String(120), unique=True, nullable=False)
password_hash = db.Column(db.String(255), nullable=False)
password_hash = db.Column(db.String(255), nullable=True)
auth_source = db.Column(db.String(20), nullable=False, default="local")
def set_password(self, password):
self.password_hash = generate_password_hash(password)
def check_password(self, password):
if not self.password_hash:
return False
return check_password_hash(self.password_hash, password)