Skip to content

fix(web): 로그인 미들웨어 안정화 및 홈 메타 타이틀 정비#499

Merged
manNomi merged 1 commit intomainfrom
codex/fix-login-refresh-needlogin-stability
Apr 19, 2026
Merged

fix(web): 로그인 미들웨어 안정화 및 홈 메타 타이틀 정비#499
manNomi merged 1 commit intomainfrom
codex/fix-login-refresh-needlogin-stability

Conversation

@manNomi
Copy link
Copy Markdown
Contributor

@manNomi manNomi commented Apr 19, 2026

요약

  • 로그인 보호 경로(/mentor, /my, /community)에서 refreshToken을 기존 JWT 유틸(isTokenExpired)로 검증하도록 변경했습니다.
  • 리프레시 토큰이 만료/비정상인 경우 쿠키를 즉시 삭제하고 /login으로 리디렉션하도록 처리했습니다.
  • 쿼리스트링 기반 로그인 사유 전달을 제거하고, isNeedLogin 쿠키 → Zustand(isNeedLogin) 브릿지 방식으로 전환했습니다.
  • 로그인 페이지에서 isNeedLogin이 true일 때 로그인 필요 토스트를 1회 노출하고 플래그를 즉시 정리하도록 구현했습니다.
  • 홈 메타 타이틀을 요청 문구(교환학생 사이트 | 솔리드 커넥션 – 교환학생 커뮤니티, 플랫폼)로 맞추고 OpenGraph/Twitter 타이틀도 일치시켰습니다.

변경 파일

  • apps/web/src/middleware.ts
  • apps/web/src/lib/zustand/useAuthStore.ts
  • apps/web/src/app/login/LoginContent.tsx
  • apps/web/src/utils/jwtUtils.ts
  • apps/web/src/app/(home)/page.tsx

검증

  • pnpm --filter @solid-connect/web exec biome check 'src/app/(home)/page.tsx' src/app/login/LoginContent.tsx src/lib/zustand/useAuthStore.ts src/middleware.ts src/utils/jwtUtils.ts
  • pnpm --filter @solid-connect/web typecheck
  • pre-commit / pre-push CI parity checks 통과 (lint/typecheck/build)

@manNomi manNomi requested review from enunsnv and wibaek as code owners April 19, 2026 08:52
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
solid-connection-web Ready Ready Preview, Comment Apr 19, 2026 8:54am
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connect-web-admin Skipped Skipped Apr 19, 2026 8:54am

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 31737198a0

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines 152 to 153
<NewsSectionDynamic newsList={newsList} />

<SiteFooter />
</div>
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Restore home footer render

This change removes <SiteFooter /> from the home page render, but apps/web/src/app/(home)/_ui/SiteFooter/index.tsx is still the only place that exposes the site's business information; after this commit that footer is no longer reachable anywhere in apps/web/src/app. This is a user-facing regression from the previous behavior and can hide required disclosure content on the main entry page.

Useful? React with 👍 / 👎.

Comment on lines +43 to +48
response.cookies.set({
name: NEED_LOGIN_COOKIE_KEY,
value: "true",
path: "/",
sameSite: "lax",
maxAge: 60,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Skip need-login cookie on prefetch redirects

buildLoginRedirectResponse always sets the isNeedLogin cookie when redirecting unauthenticated requests, including speculative requests. Since the app uses default-prefetch Links in bottom navigation to protected routes (/community, /mentor, /my), middleware can set this cookie during background prefetch and later trigger a misleading "로그인이 필요합니다" toast even when the user did not explicitly attempt a protected action. The cookie write should be limited to real navigations (non-prefetch requests).

Useful? React with 👍 / 👎.

@manNomi manNomi merged commit 254dacc into main Apr 19, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant