본문 바로가기

전체 글75

eslint 설정 { "env": { "browser": true, "jasmine": true, "jest": true, "es2021": true, "node": true }, "extends": [ "airbnb", "airbnb/hooks", "prettier", "eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended", "plugin:@typescript-eslint/recommended", "next" ], "overrides": [], // 특정 파일에 대해서 lint규칙을 재정의할 때 사용 "parser": "@typescript-eslint/parser", "parserOptions": { "ecmaVersion": "l.. 2024. 4. 5.
axios error처리 export interface ErrorResponse{ status:string; serverDataTime:string; errorCode:string; errorMessage:string; } //axios error의 타입, const isServerError = (error: unknown): error is AxiosError => { return isAxiosError(error); } //axios error타입가드 const useSignIn = (setError : any) => { const router = useRouter(); const getSignIn = async (data: any) => { try { const res = await axios.post("/sign-in",.. 2024. 2. 28.
next.js 14버전 앱라우터에 대해서 헷갈렸던 것 1. 고민 코드 2. 고민 내용 3.피드백 4. 피드백 듣고 정리 2024. 2. 27.
Authentication/Authorization Authentication 인증 : 서버가 리퀘스트를 보낸 유저가 누구인지를 파악하는 기능 Authorization 인가 : 리퀘스트가 어떤 권한이 있는지 판단하는것 클라이언트가 서버에 인증서를 받고 다시 서버에게 전달하는 방법 두 가지↓ http는 비연결성과 무상태성을 가진다. -> 한번 서버에 요청하고 응답을 받으면 연결이 끊긴다. 따라 지속성을 위해 쿠키가 등장! 1. 쿠키 서버 리스폰스나 클라이언트 코드에 따라 브라우저에 저장되는 작은 단위의 문자열 파일들 유저 인증뿐만 아니라 브라우저 이용자에 대한 개인화된 기능과 데이터 제공 수단으로 사용할 수있다. - 로그인을 하지 않아도 검색기록이 저장되거나 쇼핑카트를 사용 하거나, 테마 유지 등 쿠키 인증 사용 시 보안 설정 Domin - 서버와 요청의 .. 2024. 2. 27.