feat: Supabase Auth + Discord OAuth 인증 전환#2
Merged
Conversation
커스텀 JWT(bcrypt + jsonwebtoken + jose) 인증을 Supabase Auth + Discord OAuth로 교체. - Supabase SSR 클라이언트 헬퍼 추가 (client, server, middleware) - OAuth 콜백 라우트 추가 (/auth/callback) - 로그인 페이지를 Discord OAuth 버튼으로 교체 - 모든 API 라우트를 Supabase Auth 기반으로 리팩토링 - 미들웨어를 Supabase 세션 검증으로 교체 - admin 라우트에 Discord ID 기반 권한 체크 추가 - DB 스키마에서 users/sessions 테이블 제거 - Transaction pooler 지원 (prepare: false) - 오픈 리다이렉트, profileImageUrl 검증 등 보안 강화 - 불필요한 파일 삭제 (auth.ts, email.ts, register, verify-email 등) Co-Authored-By: Claude <noreply@anthropic.com>
- admin API(settings, curation, curation/[id])에 withAdminAuth 래퍼 적용 - members/[id] URL 파싱 시 쿼리파라미터 버그 수정 (new URL().pathname 사용) - middleware.ts 관리자 ID 파싱 로직 중복 제거 → isAdminDiscordId() 재사용 - env.ts에서 미사용 authEnvSchema(JWT), emailEnvSchema(Resend) 제거 - CLAUDE.md 최신화 Co-Authored-By: Claude <noreply@anthropic.com>
choihooo
added a commit
that referenced
this pull request
Mar 10, 2026
MessageContent Intent (100+ 서버 요구사항) 없이 동작하도록 텍스트 파싱 방식에서 Discord 버튼/인터랙션 방식으로 변경 변경 사항: - dm-handler.ts: MessageCreate → InteractionCreate 이벤트 핸들러 변경 - sendFineNotification/sendFineReminder: "납부 완료" 버튼 추가 - handleButtonInteraction: 버튼 클릭 시 벌금 상태 PAID로 변경 - bot.ts: 주석 업데이트 (Intent 활성화 불가능 명시) - fine.service.ts: isPaymentConfirmation, PaymentConfirmationWords @deprecated P0 #2 MessageContent Intent 비활성화 문제 해결: - 봇이 1개 서버에만 있어 Message Content Intent 활성화 불가 - 버튼/컴포넌트 기반으로 변경하여 Intent 없이 동작 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
choihooo
added a commit
that referenced
this pull request
Mar 10, 2026
* feat: 벌금 납부 확인을 버튼 기반으로 변경 MessageContent Intent (100+ 서버 요구사항) 없이 동작하도록 텍스트 파싱 방식에서 Discord 버튼/인터랙션 방식으로 변경 변경 사항: - dm-handler.ts: MessageCreate → InteractionCreate 이벤트 핸들러 변경 - sendFineNotification/sendFineReminder: "납부 완료" 버튼 추가 - handleButtonInteraction: 버튼 클릭 시 벌금 상태 PAID로 변경 - bot.ts: 주석 업데이트 (Intent 활성화 불가능 명시) - fine.service.ts: isPaymentConfirmation, PaymentConfirmationWords @deprecated P0 #2 MessageContent Intent 비활성화 문제 해결: - 봇이 1개 서버에만 있어 Message Content Intent 활성화 불가 - 버튼/컴포넌트 기반으로 변경하여 Intent 없이 동작 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * refactor: ChannelType.DM enum 사용으로 매직 넘버 제거 * feat: 인메모리 pendingConfirmations를 DB 영속화로 변경 P0 #9 문제 해결: - 인메모리 Map → DB pendingConfirmation 컬럼으로 변경 - 봇 재시작 시 대기 중인 확인 내역 소실 문제 해결 변경 사항: - schema.ts: fines 테이블에 pendingConfirmation 컬럼 추가 - dm-handler.ts: addPendingConfirmation, removePendingConfirmation을 DB로 변경 - isPendingConfirmation: DB 조회로 변경 - 불필요한 Map 관리 함수 제거 DB 마이그레이션: - ALTER TABLE fines ADD COLUMN pending_confirmation boolean DEFAULT true - CREATE INDEX idx_fines_pending_confirmation 테스트 완료: - ✅ DB에 벌금 생성 - ✅ DM 버튼 발송 - ✅ 버튼 클릭 시 DB에서 pending_confirmation false로 변경 - ✅ 벌금 상태 PAID로 업데이트 장점: - 봇 재시작 후에도 대기 중인 벌금 확인 유지 - DB 조회로 실시간 동시성 문제 해결 - 인메모리 상태 관리 불필요 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Changes
lib/supabase/), OAuth 콜백 (/auth/callback)auth.ts,email.ts, register/verify-email 페이지, login/register APIprepare: false)Code Review Fix (4de782f)
withAdminAuth래퍼 적용 (인증 패턴 통일)members/[id]URL 파싱 시 쿼리파라미터 포함 버그 수정 (new URL().pathname사용)middleware.ts관리자 ID 파싱 로직 중복 제거 →isAdminDiscordId()재사용env.ts에서 미사용authEnvSchema(JWT),emailEnvSchema(Resend) 제거Test plan
pnpm typecheck && pnpm build)🤖 Generated with Claude Code