first commit

This commit is contained in:
Dohyun Lim committed 2026-02-04 16:35:08 +09:00
1 parent f24ff46b09
commit dd16013816
12 files changed
+310 -31

No files matched your search

+6 -5
View File
@@ -5,10 +5,11 @@
"""
import logging
from datetime import datetime
from typing import Optional
from fastapi import HTTPException, status
from app.utils.timezone import now
from sqlalchemy import select, update
from sqlalchemy.exc import IntegrityError
from sqlalchemy.ext.asyncio import AsyncSession
@@ -167,7 +168,7 @@ class AuthService:
logger.debug(f"[AUTH] 리프레시 토큰 저장 완료 - user_id: {user.id}, user_uuid: {user.user_uuid}")
# 7. 마지막 로그인 시간 업데이트
user.last_login_at = datetime.now()
user.last_login_at = now()
await session.commit()
redirect_url = f"{prj_settings.PROJECT_DOMAIN}"
@@ -222,7 +223,7 @@ class AuthService:
if db_token.is_revoked:
raise TokenRevokedError()
if db_token.expires_at < datetime.now():
if db_token.expires_at < now():
raise TokenExpiredError()
# 4. 사용자 확인
@@ -482,7 +483,7 @@ class AuthService:
.where(RefreshToken.token_hash == token_hash)
.values(
is_revoked=True,
revoked_at=datetime.now(),
revoked_at=now(),
)
)
await session.commit()
@@ -507,7 +508,7 @@ class AuthService:
)
.values(
is_revoked=True,
revoked_at=datetime.now(),
revoked_at=now(),
)
)
await session.commit()