Repository navigation
OpenConceptLab/ocl_online#327 | TBv2 at app.classic.<env> names the same environment as app.<env> - #64
Conversation
…ame environment as app.<env> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: approve, with one should-fix before the
|
…n-in on TBv2; fix the referrer's auth=true check Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Review follow-up, d55aec1:
27 tests pass and eslint is clean. Nits 3 and 4 are unchanged: CI test wiring and the dead 🤖 Generated with Claude Code |
Merge verdict: ready to mergeA fresh review of the latest commit (d55aec1) found no blockers and nothing to fix before merging. CI is green: eslint, CodeQL and Snyk. Locally, 27 tests pass.
Nits (can be follow-ups):
Outside this PR (unchanged code): 🤖 Generated with Claude Code |
TBv2 gets a third host,
app.classic.<env>(production, staging and qa). After the switch it's the one TBv3 links to as the Classic Term Browser. This PR makes that host behave likeapp.v2.<env>.Change
toAppOrigin(src/common/env.js) mapsapp.classic.<env>toapp.<env>, as it already does forapp.v2.<env>. So onapp.classic:getEnvreturns the right environment (notdevelopment): the OpenMRS link, the logo link and error tags are right;toV3URL) goes toapp.v3.<env>, and the Mapper link (toMapperURL) goes tomap.<env>.Sign-in, sign-up and sign-out already return to
window.location.origin, so SSO needs no change here. It only needsapp.classic.<env>/*in the Keycloak clients.Sign-in from TBv3 on
app.<env>app.<env>, its Classic link sends?referrer=https://app.<env>…/?auth=true.isV3URLonly acceptedhttps://app.v3., so TBv2 didn't start the sign-in, and auth-required pages showed Access Denied until silent SSO caught up.isTBv3URL(env.js) acceptsapp[.<env>]andapp.v3[.<env>], but notapp.v2orapp.classic.isV3URLuses it.Referrer
auth=truecheckisRedirectingToLoginViaReferrerreadparamsinside its own initializer, wherepartswas meant. As a result, theauth=truehand-off to an auth-required route could never work. It now parsesparts[1].Nothing else changes on
app.<env>orapp.v2.<env>. It's safe to deploy before the host exists.Checks
node --test src/common/__tests__/env.test.js src/common/__tests__/announcement.test.js: 27 pass, includingisTBv3URLcases (app,app.<env>,app.v3; notapp.v2,app.classic,map, look-alike orhttphosts). CI eslint is clean. The new tests coverapp.classicin every env, andtoAppOriginonapp.classicandapp.v3origins.🤖 Generated with Claude Code