fix(api): support configurable users password column mapping

Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
2026-05-01 11:21:57 +08:00
parent c8ec27c6aa
commit 8c9699cd46
6 changed files with 34 additions and 1 deletions
+1
View File
@@ -24,6 +24,7 @@ class Settings(BaseSettings):
db_username: str = "fquiz"
db_password: str = "fquiz"
user_username_column: Literal["username", "user_name"] = "username"
user_password_column: Literal["password", "password_hash"] = "password_hash"
file_vfs_root: str = "./data/vfs"
minio_enabled: bool = False
minio_endpoint: str = "http://minio:9000"
+4 -1
View File
@@ -35,7 +35,10 @@ class User(Base):
unique=True,
index=True,
)
password_hash: Mapped[str] = mapped_column("password", String(255))
password_hash: Mapped[str] = mapped_column(
settings.user_password_column,
String(255),
)
status: Mapped[str] = mapped_column("state", String(32), default="ENABLED", index=True)
created_at: Mapped[datetime] = mapped_column(
"create_date",