Fix: 페이지 간 이동 시 로그아웃 문제 해결 및 기능 개선

- 토큰 저장 키 통일 (access_token으로 일관성 확보)
- 일일공수 페이지 API 스크립트 로딩 순서 수정
- 프로젝트 관리 페이지 비활성 프로젝트 표시 문제 해결
- 업로드 카테고리에 '기타' 항목 추가 (백엔드 schemas.py 포함)
- 비밀번호 변경 기능 API 연동으로 수정
- 프로젝트 드롭다운 z-index 문제 해결
- CORS 설정 및 Nginx 구성 개선
- 비밀번호 해싱 방식 pbkdf2_sha256으로 변경 (bcrypt 72바이트 제한 해결)
This commit is contained in:
hyungi
2025-10-25 07:22:20 +09:00
parent 153603ed9d
commit 41b557a709
27 changed files with 1283 additions and 311 deletions

View File

@@ -36,6 +36,11 @@ async def get_current_admin(current_user: User = Depends(get_current_user)):
)
return current_user
@router.options("/login")
async def login_options():
"""OPTIONS preflight 요청 처리"""
return {"message": "OK"}
@router.post("/login", response_model=schemas.Token)
async def login(form_data: OAuth2PasswordRequestForm = Depends(), db: Session = Depends(get_db)):
user = authenticate_user(db, form_data.username, form_data.password)

View File

@@ -20,6 +20,11 @@ def check_admin_permission(current_user: User = Depends(get_current_user)):
)
return current_user
@router.options("/")
async def projects_options():
"""OPTIONS preflight 요청 처리"""
return {"message": "OK"}
@router.post("/", response_model=ProjectSchema)
async def create_project(
project: ProjectCreate,
@@ -53,8 +58,7 @@ async def get_projects(
skip: int = 0,
limit: int = 100,
active_only: bool = True,
db: Session = Depends(get_db),
current_user: User = Depends(get_current_user)
db: Session = Depends(get_db)
):
"""프로젝트 목록 조회"""
query = db.query(Project)
@@ -68,8 +72,7 @@ async def get_projects(
@router.get("/{project_id}", response_model=ProjectSchema)
async def get_project(
project_id: int,
db: Session = Depends(get_db),
current_user: User = Depends(get_current_user)
db: Session = Depends(get_db)
):
"""특정 프로젝트 조회"""
project = db.query(Project).filter(Project.id == project_id).first()