Skip to content

๐Ÿ› ์„ธ์…˜ ์ •๋ฆฌ ์‹œ ์–ด๋“œ๋ฏผ API ํ™˜๊ฒฝ ์„ ํƒ์ด ์ดˆ๊ธฐํ™”๋˜๋Š” ๋ฌธ์ œ ์ˆ˜์ • - #621

Merged
manNomi merged 1 commit into
mainfrom
fix/admin-clear-session-env-loss
Aug 1, 2026
Merged

๐Ÿ› ์„ธ์…˜ ์ •๋ฆฌ ์‹œ ์–ด๋“œ๋ฏผ API ํ™˜๊ฒฝ ์„ ํƒ์ด ์ดˆ๊ธฐํ™”๋˜๋Š” ๋ฌธ์ œ ์ˆ˜์ •#621
manNomi merged 1 commit into
mainfrom
fix/admin-clear-session-env-loss

Conversation

@manNomi

@manNomi manNomi commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

๋ฐฐ๊ฒฝ

#619(์–ด๋“œ๋ฏผ API ํ™˜๊ฒฝ stage/prod ํ”Œ๋กœํŒ… ์Šค์œ„์ฒ˜)๊ฐ€ ์ด ๋ฒ„๊ทธ ์ˆ˜์ • ์—†์ด ๋จผ์ € ๋จธ์ง€๋˜์–ด, ์•„๋ž˜ ๋ฌธ์ œ๊ฐ€ ์•„์ง main์— ๋‚จ์•„ ์žˆ์Šต๋‹ˆ๋‹ค. ์ด PR์€ ๊ทธ ์ˆ˜์ •๋งŒ ๋‹ด์•„ ๋ณ„๋„๋กœ ์˜ฌ๋ฆฝ๋‹ˆ๋‹ค.

๋ฌธ์ œ

admins.solid-connection.com์—์„œ FAB์œผ๋กœ STAGE๋กœ ์ „ํ™˜ํ•œ ๋’ค ๋กœ๊ทธ์ธํ•ด๋„, ์‹ค์ œ ์š”์ฒญ์€ https://api.solid-connection.com/admin/auth/sign-in(PROD)์œผ๋กœ ๋‚˜๊ฐ‘๋‹ˆ๋‹ค.

์›์ธ

  1. FAB ์ „ํ™˜: clearSession() โ†’ saveAdminApiEnvironment("stage") โ†’ /auth/login์œผ๋กœ ์ด๋™ (์—ฌ๊ธฐ๊นŒ์ง€๋Š” "stage" ์ €์žฅ ์ •์ƒ)
  2. /auth/login ๋งˆ์šดํŠธ ์‹œ ensureSessionToken()์ด ์ž๋™ ์‹คํ–‰๋˜์–ด access token ์žฌ๋ฐœ๊ธ‰์„ ์‹œ๋„ (stage๋กœ ์ •์ƒ ์š”์ฒญ)
  3. STAGE ๊ณ„์ •์— ์•„์ง ์œ ํšจํ•œ refresh ์ฟ ํ‚ค๊ฐ€ ์—†์œผ๋ฉด ์žฌ๋ฐœ๊ธ‰ ์‹คํŒจ โ†’ reissueAccessTokenIfPossible์˜ catch๊ฐ€ clearSession()์„ ํ˜ธ์ถœ
  4. clearSession() ์•ˆ์˜ removeAdminApiEnvironment()๊ฐ€ ๋ฐฉ๊ธˆ ์ €์žฅํ•œ "stage" ๊ฐ’์„ ์ง€์›€
  5. ๋กœ๊ทธ์ธ ํผ ์ œ์ถœ ์‹œ resolveActiveApiBaseUrl()์ด ์ €์žฅ๊ฐ’ ์—†์Œ โ†’ ๊ธฐ๋ณธ๊ฐ’ "prod"๋กœ ํด๋ฐฑ โ†’ PROD๋กœ ๋กœ๊ทธ์ธ ์š”์ฒญ

์ฆ‰ STAGE์— ์œ ํšจํ•œ refresh ์ฟ ํ‚ค๊ฐ€ ์žˆ์œผ๋ฉด(๊ณผ๊ฑฐ ๋กœ๊ทธ์ธ ์ด๋ ฅ) 3~5๋‹จ๊ณ„ ์—†์ด ์ž๋™ ๋กœ๊ทธ์ธ๋˜์–ด ๋ฒ„๊ทธ๊ฐ€ ๋“œ๋Ÿฌ๋‚˜์ง€ ์•Š๊ณ , STAGE๋ฅผ ์ฒ˜์Œ ์“ฐ๊ฑฐ๋‚˜ ์ฟ ํ‚ค๊ฐ€ ๋งŒ๋ฃŒ๋œ ๊ฒฝ์šฐ์—๋งŒ PROD๋กœ ์ƒˆ๋Š” ํ˜•ํƒœ์˜€์Šต๋‹ˆ๋‹ค.

๊ทผ๋ณธ ์›์ธ์€ clearSession()์ด ํ™˜๊ฒฝ ํ‚ค๊นŒ์ง€ ์ง€์šฐ๋Š” ๋กœ์ง์ด ์ด๋ฉ”์ผ ๊ธฐ๋ฐ˜ ํ™˜๊ฒฝ ํŒ๋ณ„(#615) ์‹œ์ ˆ์˜ ์ž”์žฌ๋ผ๋Š” ์ ์ž…๋‹ˆ๋‹ค. ์ด์ œ ํ™˜๊ฒฝ์€ FAB์ด ๊ด€๋ฆฌํ•˜๋Š” ๋…๋ฆฝ์ ์ธ ์‚ฌ์šฉ์ž ์„ ํƒ์ด๋ฏ€๋กœ, ๋กœ๊ทธ์•„์›ƒ/์žฌ๋ฐœ๊ธ‰ ์‹คํŒจ/401 ๋“ฑ ์„ธ์…˜ ์ •๋ฆฌ ๊ฒฝ๋กœ์—์„œ ์‚ด์•„๋‚จ์•„์•ผ ํ•ฉ๋‹ˆ๋‹ค.

์ˆ˜์ •

  • clearSession()์—์„œ removeAdminApiEnvironment() ํ˜ธ์ถœ ์ œ๊ฑฐ โ€” access token๋งŒ ์ •๋ฆฌํ•˜๊ณ  ํ™˜๊ฒฝ ์„ ํƒ์€ ๊ทธ๋Œ€๋กœ ์œ ์ง€ํ•ฉ๋‹ˆ๋‹ค.
  • ์‚ฌ์šฉ์ฒ˜๊ฐ€ ์—†์–ด์ง„ removeAdminApiEnvironment ํ•จ์ˆ˜๋ฅผ localStorage.ts์—์„œ ์‚ญ์ œํ–ˆ์Šต๋‹ˆ๋‹ค.
  • switchAdminApiEnvironment์˜ JSDoc์—์„œ ๋” ์ด์ƒ ์‚ฌ์‹ค์ด ์•„๋‹Œ "clearSession์ด ํ™˜๊ฒฝ ํ‚ค๊นŒ์ง€ ์ง€์šฐ๋ฏ€๋กœ ์ˆœ์„œ๊ฐ€ ์ค‘์š”ํ•˜๋‹ค"๋Š” ์„ค๋ช…์„ ์ œ๊ฑฐํ–ˆ์Šต๋‹ˆ๋‹ค.
  • ํšŒ๊ท€ ํ…Œ์ŠคํŠธ ์ถ”๊ฐ€: "ํ™˜๊ฒฝ ์ €์žฅ โ†’ clearSession() โ†’ loadAdminApiEnvironment()๊ฐ€ ์—ฌ์ „ํžˆ ํ•ด๋‹น ํ™˜๊ฒฝ์„ ๋ฐ˜ํ™˜"์„ ์‹ค์ œ jsdom localStorage๋กœ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค(mock ์•„๋‹˜).

๊ฒ€์ฆ

  • pnpm --filter @solid-connect/admin test โ†’ 34 tests passed
  • pnpm --filter @solid-connect/admin ci:check โ†’ biome 77 files ํ†ต๊ณผ, tsc --noEmit ํด๋ฆฐ

๐Ÿค– Generated with Claude Code

@manNomi
manNomi requested a review from wibaek as a code owner August 1, 2026 16:51
@vercel

vercel Bot commented Aug 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
solid-connect-university-web Ready Ready Preview Aug 1, 2026 4:53pm
solid-connect-web-admin Ready Ready Preview Aug 1, 2026 4:53pm
1 Skipped Deployment
Project Deployment Actions Updated (UTC)
solid-connection-web Skipped Skipped Aug 1, 2026 4:53pm

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@manNomi, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
โš™๏ธ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b45497d9-7bf8-4371-8206-04caeda17467

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 8f2c130 and 9333c35.

๐Ÿ“’ Files selected for processing (4)
  • apps/admin/src/lib/auth/session.test.ts
  • apps/admin/src/lib/auth/session.ts
  • apps/admin/src/lib/utils/localStorage.test.ts
  • apps/admin/src/lib/utils/localStorage.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands.

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