API - config update + fix getting refresh token status

This commit is contained in:
Sam
2022-06-08 11:19:14 +02:00
parent 4be4f46c26
commit c4c858c6bf
4 changed files with 76 additions and 6 deletions

View File

@ -89,7 +89,7 @@ class OAuth2Token(BaseModel, OAuth2TokenMixin):
user = db.relationship('User')
def is_refresh_token_active(self) -> bool:
if self.revoked:
if self.is_revoked():
return False
expires_at = self.issued_at + self.expires_in * 2
return expires_at >= time.time()