diff --git a/src/main.ts b/src/main.ts index 65eadb9..395dad9 100644 --- a/src/main.ts +++ b/src/main.ts @@ -16,7 +16,7 @@ async function bootstrap() { 'http://localhost:8080', 'https://p-a-d.store', ], - methods: ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS'], // πŸ’‘ GET 포함 + methods: ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'PUT'], // πŸ’‘ GET 포함 credentials: true, allowedHeaders: ['Authorization', 'Content-Type'], // πŸ’‘ CORS μš”μ²­ 헀더 ν—ˆμš© exposedHeaders: ['Authorization'], // πŸ’‘ ν΄λΌμ΄μ–ΈνŠΈμ—μ„œ 응닡 헀더 μ‚¬μš© κ°€λŠ₯ diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts index f3cc7c4..47d3999 100644 --- a/src/modules/auth/auth.service.ts +++ b/src/modules/auth/auth.service.ts @@ -24,7 +24,7 @@ export class AuthService { code, client_id: process.env.GOOGLE_CLIENT_ID, client_secret: process.env.GOOGLE_CLIENT_SECRET, - redirect_uri: process.env.GOOGLE_CALLBACK_DEVELOP_URL, + redirect_uri: process.env.GOOGLE_CALLBACK_DEPLOY_URL, grant_type: 'authorization_code', } ); diff --git a/src/modules/auth/strategies/google.strategy.ts b/src/modules/auth/strategies/google.strategy.ts index 6d23dba..8a8d799 100644 --- a/src/modules/auth/strategies/google.strategy.ts +++ b/src/modules/auth/strategies/google.strategy.ts @@ -9,7 +9,7 @@ export class GoogleStrategy extends PassportStrategy(Strategy, 'google') { super({ clientID: process.env.GOOGLE_CLIENT_ID, clientSecret: process.env.GOOGLE_CLIENT_SECRET, - callbackURL: process.env.GOOGLE_CALLBACK_DEVELOP_URL, + callbackURL: process.env.GOOGLE_CALLBACK_DEPLOY_URL, scope: ['email', 'profile'], }); } diff --git a/src/modules/notification/Interceptors/notification.interceptor.ts b/src/modules/notification/Interceptors/notification.interceptor.ts index 8bae288..99b63fc 100644 --- a/src/modules/notification/Interceptors/notification.interceptor.ts +++ b/src/modules/notification/Interceptors/notification.interceptor.ts @@ -16,7 +16,7 @@ export class SseInterceptor implements NestInterceptor { res.setHeader('Content-Type', 'text/event-stream'); res.setHeader('Cache-Control', 'no-cache, no-transform'); res.setHeader('Connection', 'keep-alive'); - res.setHeader('Access-Control-Allow-Origin', 'http://localhost:5173'); // CORS μ„€μ • ν•„μš”μ‹œ μΆ”κ°€ + res.setHeader('Access-Control-Allow-Origin', '*'); // CORS μ„€μ • ν•„μš”μ‹œ μΆ”κ°€ res.setHeader('Access-Control-Allow-Credentials', 'true'); res.flushHeaders(); // μ¦‰μ‹œ 헀더λ₯Ό μ „μ†‘ν•˜μ—¬ 연결이 λŠκΈ°μ§€ μ•Šλ„λ‘ 함 } diff --git a/src/modules/project/project.service.ts b/src/modules/project/project.service.ts index 88c0410..83e0295 100644 --- a/src/modules/project/project.service.ts +++ b/src/modules/project/project.service.ts @@ -650,6 +650,11 @@ export class ProjectService { where: { id: projectId }, select: { user_id: true }, }); + + if (!auth) { + throw new NotFoundException('ν”„λ‘œμ νŠΈλ₯Ό 찾을 수 μ—†μŠ΅λ‹ˆλ‹€.'); + } + return auth.user_id === userId; } @@ -825,6 +830,10 @@ export class ProjectService { where: { post_id: projectId }, }), + this.prisma.userApplyProject.deleteMany({ + where: { post_id: projectId }, + }), + this.prisma.projectPost.delete({ where: { id: projectId }, }), diff --git a/src/search/search.service.ts b/src/search/search.service.ts index 6a8a0e6..5331151 100644 --- a/src/search/search.service.ts +++ b/src/search/search.service.ts @@ -254,6 +254,7 @@ export class SearchService { viewCount: res.view + 1, status: res.recruiting ? 'OPEN' : 'CLOSED', isMarked: res.Saves.length, + createdAT: res.created_at, })); return projects; }