Skip to content

Commit

Permalink
Chore: #80 불필요한 패키지 제거, 설치 및 유저아이디 변수명 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoonyesol committed Aug 25, 2024
1 parent ee35107 commit 7158db1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"luxon": "^3.4.4",
"react": "^18.2.0",
"react-big-calendar": "^1.13.0",
"react-cookie": "^7.2.0",
"react-dom": "^18.2.0",
"react-hook-form": "^7.51.4",
"react-icons": "^5.2.1",
Expand Down
8 changes: 4 additions & 4 deletions src/pages/setting/UserSettingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function UserSettingPage() {
const methods = useForm<EditUserInfoForm>({
mode: 'onChange',
defaultValues: {
id: USER_INFO_DUMMY.id,
username: USER_INFO_DUMMY.username,
email: USER_INFO_DUMMY.email,
nickname: USER_INFO_DUMMY.nickname,
bio: USER_INFO_DUMMY.bio,
Expand All @@ -23,7 +23,7 @@ export default function UserSettingPage() {

// form 전송 함수
const onSubmit = async (data: EditUserInfoForm) => {
const { id, email, profileUrl, ...filteredData } = data;
const { username, email, profileUrl, ...filteredData } = data;
console.log(data);

// TODO: 폼 제출 로직 작성
Expand All @@ -41,8 +41,8 @@ export default function UserSettingPage() {
disabled
label="아이디"
required={false}
errors={methods.formState.errors.id?.message}
register={methods.register('id', USER_AUTH_VALIDATION_RULES.ID)}
errors={methods.formState.errors.username?.message}
register={methods.register('username', USER_AUTH_VALIDATION_RULES.ID)}
/>

{/* 이메일 */}
Expand Down
8 changes: 4 additions & 4 deletions src/services/axiosProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ authAxios.interceptors.response.use(
if (error.response?.status === 401) {
try {
const refreshResponse = await defaultAxios.post('user/login/refresh', null, { withCredentials: true });
const newAccessToken = refreshResponse.headers.Authorization?.replace('Bearer ', '');
const newAccessToken = refreshResponse.headers.Authorization; // 응답값: `Bearer ${newAccessToken}`

authAxios.defaults.headers.Authorization = `Bearer ${newAccessToken}`;
useAuthStore.getState().setAccessToken(newAccessToken);
authAxios.defaults.headers.Authorization = newAccessToken;
useAuthStore.getState().setAccessToken(newAccessToken.replace('Bearer ', ''));

originalRequest.headers.Authorization = `Bearer ${newAccessToken}`;
originalRequest.headers.Authorization = newAccessToken;
return await axios(originalRequest);
} catch (refreshError) {
return Promise.reject(refreshError);
Expand Down
24 changes: 1 addition & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@
dependencies:
"@types/unist" "*"

"@types/hoist-non-react-statics@^3.3.1", "@types/hoist-non-react-statics@^3.3.5":
"@types/hoist-non-react-statics@^3.3.1":
version "3.3.5"
resolved "https://registry.npmjs.org/@types/hoist-non-react-statics/-/hoist-non-react-statics-3.3.5.tgz"
integrity sha512-SbcrWzkKBw2cdwRTwQAswfpB9g9LJWfjtUeW/jvNwbhC8cpmmNYVePa+ncbUe0rGTQ7G3Ff6mYUN2VMfLVr+Sg==
Expand Down Expand Up @@ -1674,11 +1674,6 @@ cookie@^0.5.0:
resolved "https://registry.npmjs.org/cookie/-/cookie-0.5.0.tgz"
integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==

cookie@^0.6.0:
version "0.6.0"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.6.0.tgz#2798b04b071b0ecbff0dbb62a505a8efa4e19051"
integrity sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==

cross-spawn@^7.0.0, cross-spawn@^7.0.2, cross-spawn@^7.0.3:
version "7.0.3"
resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz"
Expand Down Expand Up @@ -4565,15 +4560,6 @@ react-big-calendar@^1.13.0:
react-overlays "^5.2.1"
uncontrollable "^7.2.1"

react-cookie@^7.2.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/react-cookie/-/react-cookie-7.2.0.tgz#5770cd8d6b3c60c5d34ec4b7926f90281aee22ae"
integrity sha512-mqhPERUyfOljq5yJ4woDFI33bjEtigsl8JDJdPPeNhr0eSVZmBc/2Vdf8mFxOUktQxhxTR1T+uF0/FRTZyBEgw==
dependencies:
"@types/hoist-non-react-statics" "^3.3.5"
hoist-non-react-statics "^3.3.2"
universal-cookie "^7.0.0"

react-dom@^18.2.0:
version "18.3.1"
resolved "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz"
Expand Down Expand Up @@ -5580,14 +5566,6 @@ unist-util-visit@^5.0.0:
unist-util-is "^6.0.0"
unist-util-visit-parents "^6.0.0"

universal-cookie@^7.0.0:
version "7.2.0"
resolved "https://registry.yarnpkg.com/universal-cookie/-/universal-cookie-7.2.0.tgz#1f3fa9c575d863ac41b4e42272d240ae2d32c047"
integrity sha512-PvcyflJAYACJKr28HABxkGemML5vafHmiL4ICe3e+BEKXRMt0GaFLZhAwgv637kFFnnfiSJ8e6jknrKkMrU+PQ==
dependencies:
"@types/cookie" "^0.6.0"
cookie "^0.6.0"

universalify@^0.2.0:
version "0.2.0"
resolved "https://registry.npmjs.org/universalify/-/universalify-0.2.0.tgz"
Expand Down

0 comments on commit 7158db1

Please sign in to comment.