From ee3620ae168cce28f7e9a774766c3994a1d392b8 Mon Sep 17 00:00:00 2001 From: Junhwan Jang <123939697+jun-hwan00@users.noreply.github.com> Date: Sat, 25 Apr 2026 21:54:30 +0900 Subject: [PATCH 1/2] Update README.md --- README.md | 69 ------------------------------------------------------- 1 file changed, 69 deletions(-) diff --git a/README.md b/README.md index 58beeacc..8b137891 100644 --- a/README.md +++ b/README.md @@ -1,70 +1 @@ -# Getting Started with Create React App -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. - -The page will reload when you make changes.\ -You may also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can't go back!** - -If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. - -You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) From eb9efe8f03556be371ffe7edc71d1f78580a43e8 Mon Sep 17 00:00:00 2001 From: jun-hwan00 <0528klkl@naver.com> Date: Mon, 4 May 2026 22:58:34 +0900 Subject: [PATCH 2/2] =?UTF-8?q?feat:=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?=ED=95=84=ED=84=B0=EB=A7=81=20=EB=A1=9C=EC=A7=81=20=EB=B0=B1?= =?UTF-8?q?=EC=97=94=EB=93=9C=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EA=B8=B0?= =?UTF-8?q?=EB=B0=98=EC=9C=BC=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 70 ------------------- src/api/emailApi.ts | 25 ++++--- .../auth/components/EmailVerification.jsx | 23 +++--- 3 files changed, 28 insertions(+), 90 deletions(-) diff --git a/README.md b/README.md index 58beeacc..e69de29b 100644 --- a/README.md +++ b/README.md @@ -1,70 +0,0 @@ -# Getting Started with Create React App - -This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). - -## Available Scripts - -In the project directory, you can run: - -### `npm start` - -Runs the app in the development mode.\ -Open [http://localhost:3000](http://localhost:3000) to view it in your browser. - -The page will reload when you make changes.\ -You may also see any lint errors in the console. - -### `npm test` - -Launches the test runner in the interactive watch mode.\ -See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. - -### `npm run build` - -Builds the app for production to the `build` folder.\ -It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.\ -Your app is ready to be deployed! - -See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. - -### `npm run eject` - -**Note: this is a one-way operation. Once you `eject`, you can't go back!** - -If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. - -Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own. - -You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it. - -## Learn More - -You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). - -To learn React, check out the [React documentation](https://reactjs.org/). - -### Code Splitting - -This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting) - -### Analyzing the Bundle Size - -This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size) - -### Making a Progressive Web App - -This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app) - -### Advanced Configuration - -This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration) - -### Deployment - -This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment) - -### `npm run build` fails to minify - -This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify) diff --git a/src/api/emailApi.ts b/src/api/emailApi.ts index 22e80284..d4c16f63 100644 --- a/src/api/emailApi.ts +++ b/src/api/emailApi.ts @@ -10,18 +10,23 @@ interface VerifyEmailData { export const useSendVerifyEmail = () => { return useMutation({ mutationFn: async (email) => { - const response = await api.post( - "/api/auth/email/verification", - { email }, - { - headers: { "X-API-Version": "2" }, - }, - ); - return response.data; - }, + try { + const response = await api.post( + "/api/auth/email/verification", + { email }, + { headers: { "X-API-Version": "2" } }, + ); + if (!response.data.success) { + throw new Error(response.data.message); + } + return response.data; + } catch (error: any) { + const message = error.response?.data?.message || error.message; + throw new Error(message); +} +}, }); }; - // NOTE: 인증번호 확인 export const useVerifyEmailCode = () => { return useMutation({ diff --git a/src/pages/input-page/auth/components/EmailVerification.jsx b/src/pages/input-page/auth/components/EmailVerification.jsx index 2669aebf..b8e8bede 100644 --- a/src/pages/input-page/auth/components/EmailVerification.jsx +++ b/src/pages/input-page/auth/components/EmailVerification.jsx @@ -24,6 +24,7 @@ function EmailVerification({ onEmailSent, onEmailChanged, onCodeVerified }) { const [showCodeSection, setShowCodeSection] = useState(false); const [isEmailFocused, setIsEmailFocused] = useState(false); const [emailError, setEmailError] = useState(false); +const [emailErrorMessage, setEmailErrorMessage] = useState("이메일이 올바르지 않습니다."); const [code, setCode] = useState(""); const [isCodeFocused, setIsCodeFocused] = useState(false); @@ -42,9 +43,7 @@ function EmailVerification({ onEmailSent, onEmailChanged, onCodeVerified }) { }, []); const hasInput = email.trim().length > 0; - const isValidEmail = - email.endsWith("@khu.ac.kr") && email.split("@")[0].length > 0; - + const isValidEmail = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$/.test(email); const handleSend = () => { if (!hasInput) return; if (!isValidEmail) { @@ -62,9 +61,10 @@ function EmailVerification({ onEmailSent, onEmailChanged, onCodeVerified }) { setShowModal(true); onEmailSent?.(); }, - onError: () => { - // 전송 실패 - }, + onError: (error) => { + setEmailError(true); + setEmailErrorMessage(error.message); +}, }); }; @@ -156,9 +156,9 @@ onCodeVerified?.(email); * - + {/* 경희대학교 메일만 가능합니다. - + */}
@@ -174,7 +174,10 @@ onCodeVerified?.(email); setIsSent(false); onEmailChanged?.(); } - if (emailError) setEmailError(false); + if (emailError) { + setEmailError(false); + setEmailErrorMessage("이메일이 올바르지 않습니다."); + } }} onFocus={() => setIsEmailFocused(true)} onBlur={() => setIsEmailFocused(false)} @@ -195,7 +198,7 @@ onCodeVerified?.(email);
error - 이메일이 올바르지 않습니다. + {emailErrorMessage}
)}