Repository navigation
fix: 소셜 로그인 기능 임시 수정 #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix: 소셜 로그인 기능 임시 수정 #114
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,17 @@ import FindEmailResultModal from './FindEmailResultModal'; | |
|
|
||
| import { login } from '../../utils/auth'; | ||
|
|
||
| import { api } from './../../utils/axios.js'; | ||
| const getUserDetails = async () => { | ||
| try { | ||
| const res = await api.get('/api/user/details'); | ||
| return res.data; | ||
| } catch (err) { | ||
| console.error('[getUserDetails] error:', err); | ||
| throw err; | ||
| } | ||
| }; | ||
|
|
||
| const LoginForm = () => { | ||
| const nav = useNavigate(); | ||
|
|
||
|
|
@@ -62,9 +73,28 @@ const LoginForm = () => { | |
| } | ||
| }; | ||
|
|
||
| const handleSocialLogin = (provider) => { | ||
| // console.log( | ||
| // `${import.meta.env.VITE_API_URL}/oauth2/authorization/${provider}` | ||
| // ); | ||
| window.location.href = `${import.meta.env.VITE_API_URL}/oauth2/authorization/${provider}`; | ||
| }; | ||
|
|
||
| return ( | ||
| <> | ||
| <div className={styles.formContainer}> | ||
| <button | ||
| onClick={async () => { | ||
| try { | ||
| const user = await getUserDetails(); | ||
| console.log('USER:', user); | ||
| } catch (e) { | ||
| console.error(e); | ||
| } | ||
| }} | ||
| > | ||
| 유저 정보 확인 | ||
| </button> | ||
|
Comment on lines
+86
to
+97
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 임시 디버그 버튼을 제거하거나 개발 환경으로 제한하세요. 프로덕션 코드에 스타일링되지 않은 디버그 버튼이 노출되어 있습니다. PR 제목이 "임시 수정"인 점을 고려하면 의도적일 수 있으나, 다음 중 하나를 권장합니다:
옵션 2: 개발 환경에서만 표시 - <button
- onClick={async () => {
- try {
- const user = await getUserDetails();
- console.log('USER:', user);
- } catch (e) {
- console.error(e);
- }
- }}
- >
- 유저 정보 확인
- </button>
+ {import.meta.env.DEV && (
+ <button
+ onClick={async () => {
+ try {
+ const user = await getUserDetails();
+ console.log('USER:', user);
+ } catch (e) {
+ console.error(e);
+ }
+ }}
+ style={{
+ padding: '8px 16px',
+ marginBottom: '16px',
+ backgroundColor: '#f0f0f0',
+ border: '1px solid #ccc',
+ borderRadius: '4px',
+ cursor: 'pointer'
+ }}
+ >
+ 유저 정보 확인 (개발 전용)
+ </button>
+ )}디버그 버튼 제거를 원하시면 제가 정리 작업을 도와드릴 수 있습니다. 새 이슈를 생성할까요? 🤖 Prompt for AI Agents |
||
| <form className={styles.loginForm} onSubmit={handleLogin}> | ||
| <div className={styles.header}> | ||
| <div className={styles.logoBox}> | ||
|
|
@@ -131,7 +161,7 @@ const LoginForm = () => { | |
| </NavLink> | ||
| </div> | ||
|
|
||
| <SocialLoginButtons /> | ||
| <SocialLoginButtons onSocialLogin={handleSocialLogin} /> | ||
| </div> | ||
|
|
||
| {(modalStep === 'verifyPhoneForEmail' || | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
주석 처리된 console.log를 제거하세요.
주석 처리된 디버그 코드는 프로덕션 코드에 남기지 않는 것이 좋습니다.
다음 diff를 적용하여 주석을 제거하세요:
const handleSocialLogin = (provider) => { - // console.log( - // `${import.meta.env.VITE_API_URL}/oauth2/authorization/${provider}` - // ); window.location.href = `${import.meta.env.VITE_API_URL}/oauth2/authorization/${provider}`; };📝 Committable suggestion
🤖 Prompt for AI Agents