Skip to content

Commit 8cd4bcb

Browse files
authored
Merge pull request #326 from code-zero-to-one/fix/payment-redirect
QNRR-779 결 제완료시 로그인 풀리는 문제
2 parents 2434a95 + 9e40417 commit 8cd4bcb

14 files changed

Lines changed: 447 additions & 146 deletions

File tree

src/api/client/cookie.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export const setCookie = (
1515
const {
1616
path = '/',
1717
secure = true,
18-
sameSite = 'Strict',
18+
sameSite = 'Lax', // Strict에서 Lax로 변경: 외부 사이트에서 redirect 시 쿠키 전송 허용
1919
maxAge = 86400, // 1일
2020
httpOnly = false,
2121
} = options;

src/app/(admin)/admin/sales-management/payment-refund/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ const PAYMENT_HISTORY_TYPE_MAP: Record<
2626
}
2727
> = {
2828
PAYMENT_REQUESTED: { label: '결제대기', color: 'blue' },
29+
PAYMENT_WAITING_FOR_DEPOSIT: { label: '입금대기', color: 'blue' },
2930
PAYMENT_SUCCESS: { label: '결제완료', color: 'green' },
3031
PAYMENT_FAILED: { label: '결제실패', color: 'red' },
3132
PAYMENT_CANCELED: { label: '결제취소', color: 'red' },

src/app/(service)/(my)/payment-management/page.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const TRANSACTION_TYPE_MAP: Record<
3333
}
3434
> = {
3535
PAYMENT_REQUESTED: { label: '결제대기', color: 'blue' },
36+
PAYMENT_WAITING_FOR_DEPOSIT: { label: '입금대기', color: 'blue' },
3637
PAYMENT_SUCCESS: { label: '결제완료', color: 'green' },
3738
PAYMENT_FAILED: { label: '결제실패', color: 'red' },
3839
PAYMENT_CANCELED: { label: '결제취소', color: 'red' },

src/app/(service)/payment/complete/page.tsx

Lines changed: 0 additions & 126 deletions
This file was deleted.

src/components/card/mission-card.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use client';
22

3+
import dayjs from 'dayjs';
34
import { ComponentProps } from 'react';
5+
46
import { MissionListResponse } from '@/api/openapi/models';
57
import Badge from '@/components/ui/badge';
68
import Button from '@/components/ui/button';
@@ -42,9 +44,8 @@ const STATUS_CONFIG = {
4244

4345
function formatDate(dateString?: string) {
4446
if (!dateString) return '';
45-
const date = new Date(dateString);
4647

47-
return `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`;
48+
return dayjs(dateString).format('YYYY-MM-DD');
4849
}
4950

5051
function getDeadlineInfo(endDate?: string): {
@@ -53,15 +54,13 @@ function getDeadlineInfo(endDate?: string): {
5354
} | null {
5455
if (!endDate) return null;
5556

56-
const now = new Date();
57-
const end = new Date(endDate);
58-
end.setHours(23, 59, 59, 999);
57+
const now = dayjs();
58+
const end = dayjs(endDate).endOf('day');
5959

60-
const diffMs = end.getTime() - now.getTime();
61-
if (diffMs < 0) return null;
60+
if (end.isBefore(now)) return null;
6261

63-
const diffHours = diffMs / (1000 * 60 * 60);
64-
const diffDays = Math.ceil(diffMs / (1000 * 60 * 60 * 24));
62+
const diffHours = end.diff(now, 'hour');
63+
const diffDays = Math.ceil(end.diff(now, 'day', true));
6564

6665
if (diffHours <= 24) {
6766
return { text: '오늘 제출 마감', isUrgent: true };

src/components/contents/homework-detail-content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import type {
1010
import Avatar from '@/components/ui/avatar';
1111
import Button from '@/components/ui/button';
1212
import MoreMenu from '@/components/ui/dropdown/more-menu';
13-
import { useUserStore } from '@/stores/useUserStore';
1413
import ConfirmDeleteModal from '@/features/study/group/ui/confirm-delete-modal';
1514
import {
1615
useDeleteHomework,
@@ -22,6 +21,7 @@ import {
2221
useUpdatePeerReview,
2322
} from '@/hooks/queries/peer-review-api';
2423
import { useIsLeader } from '@/stores/useLeaderStore';
24+
import { useUserStore } from '@/stores/useUserStore';
2525
import DeleteHomeworkModal from '../modals/delete-homework-modal';
2626
import EditHomeworkModal from '../modals/edit-homework-modal';
2727

src/components/pages/group-study-list-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ import StudyFilter, {
1414
import StudySearch from '@/components/filtering/study-search';
1515
import PageContainer from '@/components/layout/page-container';
1616
import Button from '@/components/ui/button';
17+
import { useAuth } from '@/hooks/common/use-auth';
1718
import { useGetStudies } from '@/hooks/queries/study-query';
1819
import GroupStudyFormModal from '../../features/study/group/ui/group-study-form-modal';
1920
import GroupStudyPagination from '../../features/study/group/ui/group-study-pagination';
2021
import GroupStudyList from '../lists/group-study-list';
21-
import { useAuth } from '@/hooks/common/use-auth';
2222

2323
const PAGE_SIZE = 15;
2424

src/components/pages/premium-study-list-page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import PremiumStudyList from '@/components/premium/premium-study-list';
1717
import PremiumStudyPagination from '@/components/premium/premium-study-pagination';
1818
import Button from '@/components/ui/button';
1919
import GroupStudyFormModal from '@/features/study/group/ui/group-study-form-modal';
20-
import { useGetStudies } from '@/hooks/queries/study-query';
2120
import { useAuth } from '@/hooks/common/use-auth';
21+
import { useGetStudies } from '@/hooks/queries/study-query';
2222

2323
const PAGE_SIZE = 15;
2424

src/components/summary/study-info-summary.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ export default function SummaryStudyInfo({ data }: Props) {
132132
};
133133

134134
const isApplyDisabled =
135-
!isLoggedIn ||
136135
isLeader ||
137136
myApplicationStatus?.status !== 'NONE' ||
138137
groupStudyStatus !== 'RECRUITING' ||

src/features/auth/model/use-auth-mutation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import { useRouter } from 'next/navigation';
66
import { deleteCookie, getCookie } from '@/api/client/cookie';
77
import { logout, signUp, uploadProfileImage } from '@/features/auth/api/auth';
88
import { hashValue } from '@/utils/hash';
9-
import { useUserStore } from '../../../stores/useUserStore';
109
import { SignUpRequest, SignUpResponse } from './types';
10+
import { useUserStore } from '../../../stores/useUserStore';
1111

1212
// 회원가입 요청 커스텀 훅
1313
export const useSignUpMutation = () => {

0 commit comments

Comments
 (0)