Repository navigation
로그인 엔드포인트 및 콜백 중복 실행 수정 + CloudFront 배포 설정 반영 - #53
Merged
Merged
Conversation
- buildAuthorizeUrl이 login일 때 /login 대신 /oauth2/authorize를 호출하도록 수정 - AuthCallbackPage에 useRef 가드를 추가해 StrictMode 이중 실행 시 code 교환이 두 번 일어나는 문제 방지 - 토큰 교환 성공 시에만 홈으로 이동하고, 실패 시 리다이렉트 대신 화면에 오류를 표시하도록 변경 Ref: #51 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
기존 kickytime-bucket은 다른 AWS 계정이 선점한 전역 네임스페이스 이름이라 현재 계정(205366594951)에서 생성할 수 없다. 계정 ID를 포함한 이름으로 교체한다. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Mminzy22
approved these changes
Aug 8, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
📌 PR 개요
새로고침 시 로그인 상태가 풀리는 문제(#51)를 해결하고, AWS 재배포에 맞춰
S3 + CloudFront 배포 대상을 갱신합니다.
🔍 변경 사항
인증 (🐛 fix)
src/auth/hostedUi.tsbuildAuthorizeUrl이 로그인 시/login을 호출하고 있었으나, Cognito Hosted UI의Authorization Code + PKCE 진입점은
/oauth2/authorize입니다. 엔드포인트를 분기하도록 수정/signup유지src/pages/AuthCallbackPage.tsxuseRef가드를 추가해 React StrictMode에서 effect가 두 번 실행될 때authorization code 교환이 중복 호출되는 문제 방지
/login으로 강제 리다이렉트하던 동작을 제거하고 화면에 오류를 표시배포 설정 (🔧 config)
.github/workflows/s3cloudfront-cd.ymlS3_BUCKET을kickytime-bucket→kickytime-frontend-205366594951로 변경현재 계정(205366594951)에서 생성이 불가능했습니다
🏗 함께 진행된 AWS 인프라 변경 (코드 외)
이 PR이 병합되어야 아래 구성이 실제로 동작합니다.
kickytime-frontend-205366594951생성 (퍼블릭 액세스 전면 차단)E23NEPCC9F13GF생성 (d2hk3a4qv3wwww.cloudfront.net)*→ S3 오리진 (OAC)/api/*→ ALB 오리진 (CachingDisabled + AllViewerExceptHostHeader)403 → /index.html (200)로 SPA 라우팅 처리kickytime-frontend-deploy-role생성VITE_API_BASE_URL=/api/(CloudFront 동일 도메인 상대 경로)VITE_COGNITO_REDIRECT_URI=https://d2hk3a4qv3wwww.cloudfront.net/auth/callbackVITE_COGNITO_DOMAIN,VITE_COGNITO_CLIENT_ID를 현재 사용자 풀 기준으로 교체AWS_DEPLOY_ROLE_ARN,CLOUDFRONT_DISTRIBUTION_ID)VITE_API_BASE_URL을 상대 경로로 두어 브라우저 기준 same-origin이 되므로백엔드 CORS 설정과 애플리케이션 코드는 변경하지 않았습니다.
🧪 테스트 방법
s3cloudfront-cd.yml이 실행됩니다.env.production키 목록과BUILD_DIR=dist감지를 확인합니다https://d2hk3a4qv3wwww.cloudfront.net접속 → 메인 화면 렌더링 확인/oauth2/authorize인지 확인/auth/callback에서 홈으로 1회만 이동하는지 확인(개발자 도구 Network에서
/oauth2/token요청이 1건인지 확인)/matches접속 후 새로고침 → 404 없이 화면이 유지되는지 확인✅ 체크리스트
📎 참고 이슈
Ref: #51