프론트엔드 추가 및 자동매매 로직 개선:
Some checks failed
Build Push and Restart Compose / deploy (push) Failing after 1m42s

- Svelte 기반 프론트엔드 프로젝트 초기 설정 추가 (`vite`, `tailwindcss` 등 포함).
- "자동매매" 주요 상태 및 규칙 관리 페이지 구현.
- 1차/2차 손절 및 익절 조건 평가 로직 추가(`calcStopTargets`, `evalExitReason` 등).
- 포지션 상세 로그 및 WebSocket 기반 실시간 로그 스트림 추가.
- API 서비스 및 Frontend 간 Proxy 설정(Vite 서버).
- 세션 체크를 위한 `CheckSession` 핸들러 추가.
This commit is contained in:
hayato5246
2026-04-05 20:30:52 +09:00
parent f10a1ede3b
commit 00ffc6b54c
58 changed files with 6425 additions and 104 deletions

View File

@@ -55,9 +55,9 @@ func (h *AuthHandler) Login(w http.ResponseWriter, r *http.Request) {
return
}
id := r.FormValue("id")
id := r.FormValue("id")
password := r.FormValue("password")
next := r.FormValue("next")
next := r.FormValue("next")
if next == "" {
next = "/"
}
@@ -87,6 +87,18 @@ func (h *AuthHandler) Login(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, next, http.StatusFound)
}
// CheckSession GET /api/auth/check — 세션 유효성 확인 (200 OK / 401 Unauthorized)
func (h *AuthHandler) CheckSession(w http.ResponseWriter, r *http.Request) {
cookie, err := r.Cookie(middleware.SessionCookieName)
if err != nil || !h.sessionSvc.Validate(cookie.Value) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusUnauthorized)
_, _ = w.Write([]byte(`{"error":"unauthorized"}`))
return
}
w.WriteHeader(http.StatusOK)
}
// Logout POST /logout — 세션 삭제 후 /login 리다이렉트
func (h *AuthHandler) Logout(w http.ResponseWriter, r *http.Request) {
if cookie, err := r.Cookie(middleware.SessionCookieName); err == nil {