Merge pull request 'Add LDAP Aunthentication' (#18) from prajakta-devs into pankaj-dev

Reviewed-on: #18
Reviewed-by: Pankaj J Patil <pankajjpatil2001@gmail.com>
This commit was merged in pull request #18.
This commit is contained in:
2026-08-10 05:48:01 +00:00
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)