1. Explain the difference between request and response interceptors in Axios.
Request interceptor: 요청 보내기 전 가로채서 수정.
Response interceptor: 응답 받은 후 가로채서 처리.
2. How would you add a custom header to all Axios requests using interceptors?
axios.interceptors.request.use(config =>
{
config.headers['Custom-Header'] = 'value'; return config;
});
3. What is a JWT, and what are its three components?
JWT (JSON Web Token)는 인증에 사용하는 토큰. 세 부분: Header, Payload, Signature.
4. Explain the difference between signed and encrypted JWTs.
Signed JWT: 변조 방지 (서명).Encrypted JWT: 데이터 자체를 암호화해서 보호.
5. How do you store JWTs on the client side? What are the trade-offs between localStorage and cookies?
localStorage: 간편하지만 XSS에 취약.
Cookies (HttpOnly): 더 안전하지만 CSRF 공격 주의.
6. What measures can you take to prevent JWT from being tampered with?
비밀키로 서명(Sign)하고, 서버에서 서명 검증.
7. How can you prevent a JWT from being stolen (e.g., token hijacking)?
HTTPS 사용- 토큰 짧은 수명 설정-
HttpOnly 쿠키 저장-
토큰 재발급(refresh) 전략 사용
8. What is JWT, and why is it used?
인증, 권한 부여 등에 사용하는 가볍고 안전한 토큰 포맷.
9. What are the three parts of a JWT? Explain their purpose.
Header: 타입과 알고리즘.Payload: 사용자 데이터.Signature: 무결성 검증.
10. How does JWT differ from session-based authentication?
JWT: 클라이언트가 토큰 저장.Session: 서버가 세션 저장.
11 . How can you include a JWT in the headers of an Axios request?
axios.defaults.headers.common['Authorization'] = 'Bearer ' + token;
https://dev.to/shemanto_sharkar/questions-for-react-job-interview-587m
Questions for React job interview
Explain the difference between request and response interceptors in Axios. How would you add a custom...
dev.to
'FrontEnd > React.js' 카테고리의 다른 글
토스의 "자료구조를 활용한 복잡한 프론트엔드 컴포넌트 제작하기"를 구현해보기 (3) (0) | 2025.04.14 |
---|---|
토스의 "자료구조를 활용한 복잡한 프론트엔드 컴포넌트 제작하기"를 구현해보기 (2) (0) | 2025.04.13 |
토스의 "자료구조를 활용한 복잡한 프론트엔드 컴포넌트 제작하기"를 구현해보기 (1) (0) | 2025.04.09 |
[React] 카카오 api를 통해 주소를 좌표로 변환해보기 (undefinded Geocorder) (1) | 2024.09.06 |
react-day-picker 에서 한글화 시키기 (feat. date-fns) (1) | 2024.09.04 |