fix(task7): invalidate tokens on password change or reset

This commit is contained in:
Atharv1705
2026-11-17 18:31:45 +05:30
parent b8639bc52a
commit 9276064d18
11 changed files with 145 additions and 4 deletions
+1
View File
@@ -67,6 +67,7 @@ class User(Base):
password_hash: Mapped[str] = mapped_column(String(255), nullable=False)
role: Mapped[str] = mapped_column(String(50), nullable=False)
department_id: Mapped[Optional[int]] = mapped_column(ForeignKey("departments.id"), nullable=True)
token_version: Mapped[int] = mapped_column(Integer, default=0, server_default="0", nullable=False)
is_active: Mapped[bool] = mapped_column(Boolean, default=True, nullable=False)
created_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now, nullable=False)
updated_at: Mapped[datetime] = mapped_column(DateTime(timezone=True), default=utc_now, onupdate=utc_now, nullable=False)