jwt token timezone 변경 .
This commit is contained in:
1 parent
1cb698e8ea
commit
f153157227
3 files changed
+21
-10
No files matched your search
@@ -5,7 +5,7 @@
|
||||
"""
|
||||
|
||||
import logging
|
||||
from datetime import datetime, timezone
|
||||
from datetime import datetime
|
||||
from typing import Optional
|
||||
|
||||
from sqlalchemy import select, update
|
||||
@@ -113,7 +113,7 @@ class AuthService:
|
||||
logger.debug(f"[AUTH] 리프레시 토큰 저장 완료 - user_id: {user.id}, user_uuid: {user.user_uuid}")
|
||||
|
||||
# 7. 마지막 로그인 시간 업데이트
|
||||
user.last_login_at = datetime.now(timezone.utc)
|
||||
user.last_login_at = datetime.now()
|
||||
await session.commit()
|
||||
|
||||
redirect_url = f"{prj_settings.PROJECT_DOMAIN}"
|
||||
@@ -168,7 +168,7 @@ class AuthService:
|
||||
if db_token.is_revoked:
|
||||
raise TokenRevokedError()
|
||||
|
||||
if db_token.expires_at < datetime.now(timezone.utc):
|
||||
if db_token.expires_at < datetime.now():
|
||||
raise TokenExpiredError()
|
||||
|
||||
# 4. 사용자 확인
|
||||
@@ -428,7 +428,7 @@ class AuthService:
|
||||
.where(RefreshToken.token_hash == token_hash)
|
||||
.values(
|
||||
is_revoked=True,
|
||||
revoked_at=datetime.now(timezone.utc),
|
||||
revoked_at=datetime.now(),
|
||||
)
|
||||
)
|
||||
await session.commit()
|
||||
@@ -453,7 +453,7 @@ class AuthService:
|
||||
)
|
||||
.values(
|
||||
is_revoked=True,
|
||||
revoked_at=datetime.now(timezone.utc),
|
||||
revoked_at=datetime.now(),
|
||||
)
|
||||
)
|
||||
await session.commit()
|
||||
|
||||
Reference in new issue
Block a user