Skip to content

Commit

Permalink
Merge pull request #262 from TEAM-MONGDOL/develop
Browse files Browse the repository at this point in the history
develop -> main
  • Loading branch information
eunji0714 authored Aug 19, 2024
2 parents 68ac1b7 + 0414837 commit 1407c42
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ const UserWkDetailPage = ({ params }: UserWkDetailProps) => {
}}
/>
)}

{reviewData.reviewInfosForWkt.map((review) => (
<WkReviewInfo
key={review.wktTitle}
Expand Down
13 changes: 8 additions & 5 deletions src/app/_components/user/workation/WkReviewInfo.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
'use client';

import React, { useState } from 'react';
import React from 'react';
import Image from 'next/image';
import { StarRateEmptyIcon, StarRateIcon } from '@/_assets/icons';
import UserFilteringSectionContainer from '@/_components/user/common/containers/UserFilteringSectionContainer';
import { ReviewInfo } from '@/_constants/common';
import dayjs from 'dayjs';

Expand Down Expand Up @@ -31,16 +30,20 @@ const WkReviewInfo = ({
<div className="my-5 flex items-center">
<p className="mr-4 text-h3 font-semibold">{reviewer}</p>
<p className="text-4 text-sub-200">
{department} + {title}
{department} · {title}
</p>
<div className="ml-auto flex flex-col justify-center">
<div className="mb-1 flex">
{[...Array(rating)].map((_, index) => (
<Image key={rating} src={StarRateIcon} alt="StarRateIcon" />
<Image
key={`star-filled-${index}`}
src={StarRateIcon}
alt="StarRateIcon"
/>
))}
{[...Array(5 - rating)].map((_, index) => (
<Image
key={rating}
key={`star-filled-${index}`}
src={StarRateEmptyIcon}
alt="StarRateEmptyIcon"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/app/_components/user/workation/WkSlider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ const Slider = ({ id }: { id: number }) => {
backgroundColor: isWinner
? '#FBD501'
: member.accountId === userId
? '#FDE000'
? '#FFFFFF'
: 'transparent',
}}
onMouseEnter={() =>
Expand Down
7 changes: 4 additions & 3 deletions src/app/api/auth/[...nextauth]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const handler = NextAuth({
accountId: extendedUser.id,
isAdmin: extendedUser.isAdmin,
accessToken: extendedUser.accessToken,
expiredAt: dayjs().add(10, 'minute').valueOf(), // 밀리초 단위로 수정
expiredAt: dayjs().add(30, 'minute').valueOf(), // 밀리초 단위로 수정
};

return token;
Expand All @@ -73,11 +73,12 @@ const handler = NextAuth({
const { accessToken } = res.data.data;
if (!accessToken) {
signOut();
throw new Error('로그인 정보가 만료되었습니다. 다시 로그인해주세요.');
}
console.log('new access token:', accessToken);

token.accessToken = accessToken;
token.expiredAt = dayjs().add(10, 'minute').valueOf();
token.expiredAt = dayjs().add(30, 'minute').valueOf();

return token;
}
Expand All @@ -101,7 +102,7 @@ const handler = NextAuth({
},
session: {
strategy: 'jwt',
maxAge: 60 * 10, // 10 minutes
maxAge: 60 * 30, // 30 minutes
},
secret: process.env.NEXTAUTH_SECRET,
});
Expand Down
6 changes: 0 additions & 6 deletions src/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,13 @@ export async function middleware(request: NextRequest) {
const session = await getSessionFromRequest(request);

if (request.nextUrl.pathname.startsWith('/login')) {
console.log('call middleware - /login');

return withoutAuth(request, session);
}

if (request.nextUrl.pathname.startsWith('/admin')) {
console.log('call middleware - /admin');

return withAdmin(request, session);
}

console.log('call middleware - others');

return withAuth(request, session);
}

Expand Down

0 comments on commit 1407c42

Please sign in to comment.