timezone auth 비교 수정 .

get_video
hbyang 2026-02-10 13:54:22 +09:00
parent bc777ba66c
commit 4e87c76b35
3 changed files with 6 additions and 6 deletions

View File

@ -461,7 +461,7 @@ async def generate_test_token(
session.add(db_refresh_token)
# 마지막 로그인 시간 업데이트
user.last_login_at = now()
user.last_login_at = now().replace(tzinfo=None)
await session.commit()
logger.info(

View File

@ -168,7 +168,7 @@ class AuthService:
logger.debug(f"[AUTH] 리프레시 토큰 저장 완료 - user_id: {user.id}, user_uuid: {user.user_uuid}")
# 7. 마지막 로그인 시간 업데이트
user.last_login_at = now()
user.last_login_at = now().replace(tzinfo=None)
await session.commit()
redirect_url = f"{prj_settings.PROJECT_DOMAIN}"
@ -223,7 +223,7 @@ class AuthService:
if db_token.is_revoked:
raise TokenRevokedError()
if db_token.expires_at < now():
if db_token.expires_at < now().replace(tzinfo=None):
raise TokenExpiredError()
# 4. 사용자 확인
@ -483,7 +483,7 @@ class AuthService:
.where(RefreshToken.token_hash == token_hash)
.values(
is_revoked=True,
revoked_at=now(),
revoked_at=now().replace(tzinfo=None),
)
)
await session.commit()
@ -508,7 +508,7 @@ class AuthService:
)
.values(
is_revoked=True,
revoked_at=now(),
revoked_at=now().replace(tzinfo=None),
)
)
await session.commit()

View File

@ -107,7 +107,7 @@ def get_refresh_token_expires_at() -> datetime:
Returns:
리프레시 토큰 만료 datetime (로컬 시간)
"""
return now() + timedelta(
return now().replace(tzinfo=None) + timedelta(
days=jwt_settings.JWT_REFRESH_TOKEN_EXPIRE_DAYS
)