Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 식자재 무한스크롤, 리프레시토큰, 프로필 변경, 로티 변경 #34

Merged
merged 18 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"eslint-plugin-react": "^7.33.2",
"framer-motion": "^11.0.3",
"lodash": "^4.17.21",
"lottie-react": "^2.4.0",
"next": "14.0.3",
"react": "^18",
"react-dom": "^18",
Expand Down
18 changes: 8 additions & 10 deletions src/api/axiosInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ axiosInstance.interceptors.response.use(
const originalRequest = error.config;

if (error.response?.status === 401 && !originalRequest._retry) {
/*
originalRequest._retry = true;

const refreshToken =
Expand All @@ -36,22 +35,21 @@ axiosInstance.interceptors.response.use(
: null;

try {
const refreshResponse = await axios.post('/users/kakao-login', {
refreshToken,
});

if (typeof window !== 'undefined') {
localStorage.setItem('accessToken', refreshResponse.data.accessToken);
originalRequest.headers['Refresh-Token'] = refreshToken;
const res = await axiosInstance(originalRequest);
const newAccessToken = res.headers['new-access-token'];
if (newAccessToken) {
localStorage.setItem('accessToken', newAccessToken);
}

originalRequest.headers.Authorization = `Bearer ${refreshResponse.data.accessToken}`;
originalRequest.headers.Authorization = `Bearer ${newAccessToken}`;
return await axiosInstance(originalRequest);
} catch (refreshError) {
console.error('Error refreshing token:', refreshError);
throw refreshError;
}
*/
window.location.href = '/login';

// window.location.href = '/login';
}

return await Promise.reject(error);
Expand Down
317 changes: 0 additions & 317 deletions src/assets/lottie.json

This file was deleted.

Binary file added src/assets/lottie.webp
Binary file not shown.
4 changes: 2 additions & 2 deletions src/components/atoms/IngredientDateTag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const IngredientDateTag: React.FC<IngredientDateTagProps> = ({ dDay }) => {
let textDay;

// dDay에 따라서 className 설정
if (dDay <= 0) {
if (dDay < 0) {
className = 'bg-gray1 text-gray6';
backgroundColor = '';
textDay = `D+${Math.abs(dDay)}`;
Expand All @@ -31,7 +31,7 @@ const IngredientDateTag: React.FC<IngredientDateTagProps> = ({ dDay }) => {

return (
<div
className={`w-64 p-9 rounded-6 text-center body1-semibold ${className}`}
className={`min-w-[64px] p-9 rounded-6 text-center body1-semibold ${className}`}
style={{ backgroundColor }}
>
{textDay}
Expand Down
Loading
Loading