Repository navigation
refactor(web): resolve admin scope to an Office; share status page and response helpers - #199
Merged
Merged
Conversation
geminixiang
marked this pull request as ready for review
October 26, 2026 09:31
geminixiang
force-pushed
the
refactor/simplify-web-portals
branch
from
October 26, 2026 10:49
dd8568d to
a534d97
Compare
…page Admin handlers take the office from officeFromQuery/officeFromBody, which answer 403 themselves, replacing AdminConversationScope, resolveConversationScope and scopedOffice. Login, Session View and the admin access-denied page render through portal-shell's renderStatusPage. Session View's eyebrow uses PRODUCT_NAME; the admin access-denied page takes the shared card layout instead of its centered inline-styled card.
The login portal answers through portal-shell's jsonResponse and a new htmlResponse instead of hand-written writeHead/end pairs, and keeps pending OAuth states in an InMemoryTokenStore, whose random 16-byte key, expiry check and delete-before-check consume match the Map it replaces. Behavior change: every /link, /api/link/complete, /api/oauth/start and /oauth/callback response now carries Cache-Control: no-store, and JSON responses declare charset=utf-8. A test asserts both headers.
geminixiang
force-pushed
the
refactor/simplify-web-portals
branch
from
October 26, 2026 10:53
a534d97 to
6231a23
Compare
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.
Stage 5 of
docs/research/simplify-modules-2026-10.md(#196). 7 files, +277 / −202; production code +201 / −190, so this does not shrink the code as the survey estimated (~90 lines). It removes concepts rather than lines: the formatter splits eachhtmlResponse(...)call over several lines.officeFromQuery/officeFromBodyreturnOffice | undefinedat all 16 call sitesAdminConversationScopeand three resolversrenderStatusPageinportal-shell.tsfor login, Session View, and adminjsonResponse/ a newhtmlResponse;oauthStatesusesInMemoryTokenStoreVisible and header changes
/link,/api/link/complete,/api/oauth/start,/oauth/callbacknow sendCache-Control: no-store; JSON responses addcharset=utf-8. A new test asserts both and fails onmain.PRODUCT_NAME(still "mikan"); no longer ships the session inline script.Verification
npm run typechecknpm testnpm run duplicationOutside the Slack message path (Admin portal), so done when CI passes. Draft pending a decision on whether the admin visual change and the line-count result are acceptable.