Skip to content

[5주차/동동] 워크북 제출합니다.#48

Open
bukyung03 wants to merge 3 commits intoUMC-Inha:동동/mainfrom
bukyung03:main
Open

[5주차/동동] 워크북 제출합니다.#48
bukyung03 wants to merge 3 commits intoUMC-Inha:동동/mainfrom
bukyung03:main

Conversation

@bukyung03
Copy link
Copy Markdown

@bukyung03 bukyung03 commented Apr 27, 2026

✅ 워크북 체크리스트

  • 모든 핵심 키워드 정리를 마쳤나요?
  • 핵심 키워드에 대해 완벽히 이해하셨나요?
  • 이론 학습 이후 직접 실습을 해보는 시간을 가졌나요?
  • 미션을 수행하셨나요?
  • 미션을 기록하셨나요?

✅ 컨벤션 체크리스트

  • 디렉토리 구조 컨벤션을 잘 지켰나요?
  • pr 제목을 컨벤션에 맞게 작성하였나요?
  • pr에 해당되는 이슈를 연결하였나요?(중요)
  • 적절한 라벨을 설정하였나요?
  • 파트장에게 code review를 요청하기 위해 reviewer를 등록하였나요?
  • 닉네임/main 브랜치의 최신 상태를 반영하고 있는지 확인했나요?(매우 중요!)

📌 주안점

@bukyung03 bukyung03 self-assigned this Apr 27, 2026
@bukyung03 bukyung03 requested a review from qkrdmsthff as a code owner April 27, 2026 20:41
@bukyung03 bukyung03 changed the title [5주차/동동] 워크북 제출합니다 [5주차/동동] 워크북 제출합니다. Apr 27, 2026
Comment thread mission/chapter05/mission02/src/apis/axios.ts
Comment thread mission/chapter05/mission03/src/apis/axios.ts Outdated
Comment thread mission/chapter05/mission03/src/context/AuthContext.tsx Outdated
Copy link
Copy Markdown
Collaborator

@qkrdmsthff qkrdmsthff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 동동 !! 열심히 하셨네용 수고 많으셨어요 이번주도 화이팅 ~~

Comment on lines +10 to +18
const NicknameStep = ({ onSubmit, isLoading }: Props) => {
const {
register,
handleSubmit,
formState: { errors, isValid },
} = useForm<NicknameFormValues>({
resolver: zodResolver(nicknameSchema),
mode: 'onChange',
});
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mode : 'onChange'isValid 를 조합해서 사용 시 매 타이핑마다 유효성 검사가 실행되어 성능에 미세한 영향을 줄 수 있습니다! 현재는 폼의 크기가 작아서 괜찮지만 폼의 크기가 커진다면,

=> isDirty && isValid 를 사용하여 체크하는 것이 더 좋을 수 있습니다.

Comment on lines +37 to +43
const[accessToken, setAccessToken] = useState<string|null>(
// 지연 초기화하는 이유? LocalStorage 값은 한번 값을 받으면 계속해서 리렌더링될 필요가 없음
getAccessTokenFromStorage(), // 함수를 넣어줘야 지연 초기화가 됨
);
const[refreshToken, setRefreshToken] = useState<string|null>(
getRefreshTokenFromStorage(),
);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

함수를 넣어줘야 지연 초기화가 됨이라고 표기하였는데, 지금 해당 코드는 매 렌더링마다 함수가 호출되고 있습니다!

useState<string|null>(() => getRefreshTokenFromStorage());

해당 코드처럼 수정하면 최초 마운트 시에만 호출되도록 할 수 있습니다!

setAccessToken(newAccessToken);
setRefreshToken(newRefreshToken);
toast.success("로그인 성공");
window.location.href="/my";
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

현재 SPA 의 장점을 무시하고 window.location.href 를 사용해서 페이지를 이동하고 있습니다! react-route-domuseNavigate 훅을 사용해 보는 것을 권장합니다!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Chapter05_리프레시 토큰 기반의 안전한 접근 제어 전략과 소셜 로그인

5 participants