diff --git a/src/app/login/loginoption.tsx b/src/app/login/loginoption.tsx index 213f273..e775f70 100644 --- a/src/app/login/loginoption.tsx +++ b/src/app/login/loginoption.tsx @@ -3,14 +3,14 @@ import React from "react"; import { useState } from "react"; type LoginOptionProps = { - onClick?: () => void; - className?: string; + onClick?: () => void; + className?: string; loginErrorModalEnabled?: boolean; setLoginErrorModalEnabled?: (enabled: boolean) => void; }; export default function LoginOption({ - className, + className, loginErrorModalEnabled, setLoginErrorModalEnabled, }: LoginOptionProps) { @@ -18,7 +18,7 @@ export default function LoginOption({ const [isOpen, setIsOpen] = useState(false); - return ( + return (
- { isOpen && ( + {isOpen && (
-
    -
  • -

    login error modal

    - -
  • -
+
    +
  • +

    login error modal

    + +
  • +
)}
- ); + ); } \ No newline at end of file diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 1483422..4063e11 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -19,8 +19,8 @@ export default function LoginPage() { const [isUserIdFocused, setIsUserIdFocused] = useState(false); const [isPasswordFocused, setIsPasswordFocused] = useState(false); const [isLoginErrorOpen, setIsLoginErrorOpen] = useState(false); - const [idError, setIdError] = useState(""); - const [passwordError, setPasswordError] = useState(""); + const [idError, setIdError] = useState(""); + const [passwordError, setPasswordError] = useState(""); async function handleSubmit(e: React.FormEvent) { e.preventDefault(); @@ -31,7 +31,7 @@ export default function LoginPage() { try { const response = await fetch("https://hrdi.coconutmeet.net/auth/login", { method: "POST", - headers: {"Content-Type": "application/json",}, + headers: { "Content-Type": "application/json", }, body: JSON.stringify({ email: userId, password: password @@ -61,7 +61,7 @@ export default function LoginPage() { const data = await response.json(); console.log("로그인 성공:", data); - + // 로그인 성공 시 토큰 저장 (다양한 필드명 지원) const token = data.token || data.accessToken || data.access_token; if (token) { @@ -73,11 +73,11 @@ export default function LoginPage() { console.warn("토큰이 응답에 없습니다. 응답 데이터:", data); // 토큰이 없어도 로그인은 성공했으므로 진행 } - + // 리다이렉트 경로 확인 const searchParams = new URLSearchParams(window.location.search); const redirectPath = searchParams.get('redirect') || '/'; - + // 메인 페이지로 이동 router.push(redirectPath); } catch (error) { @@ -94,18 +94,18 @@ export default function LoginPage() { open={isLoginErrorOpen} onClose={() => setIsLoginErrorOpen(false)} /> - setIsLoginErrorOpen(true)} - loginErrorModalEnabled={isLoginErrorOpen} - setLoginErrorModalEnabled={setIsLoginErrorOpen} + loginErrorModalEnabled={isLoginErrorOpen} + setLoginErrorModalEnabled={setIsLoginErrorOpen} />
{/* 로고 영역 */}
-
- -
+
+ +
XR LMS
@@ -249,11 +249,10 @@ export default function LoginPage() {
-
+

Copyright ⓒ 2025 XL LMS. All rights reserved

); } - \ No newline at end of file