This commit is contained in:
Lev 2026-04-20 23:36:13 +03:00
parent ecc16a198d
commit 821e5a65ab
4 changed files with 20 additions and 6 deletions

View file

@ -14,4 +14,4 @@ class AuthToken(Base):
revoked: Mapped[bool] = mapped_column(default=False, nullable=False)
revoked_at: Mapped[datetime | None] = mapped_column(DateTime(timezone=True), nullable=True)
def is_valid(self) -> bool:
return not self.revoked and self.expires_at > datetime.utcnow()
return not self.revoked and self.expires_at > datetime.utcnow()