Skip to content

OpenConceptLab/ocl_online#327 | TBv2 stays at app.v2.<env> only; drop the app.classic mapping - #65

Merged
snyaggarwal merged 1 commit into
masterfrom
ocl_online-327-app-v2-only
Dec 1, 2026
Merged

snyaggarwal merged 1 commit into
masterfrom
ocl_online-327-app-v2-only

Conversation

@snyaggarwal

Copy link
Copy Markdown
Contributor

The app.classic host isn't being created, so TBv2 stays at app.v2.<env> (and app.<env> until the TBv3 switch). This PR removes the app.classic parts of #64 and keeps the sign-in fixes, which the switch still needs.

Change

  • toAppOrigin goes back to mapping app.v2. only. The comments and tests drop app.classic.
  • isTBv3URL no longer needs a classic exclusion. app.v2 is still rejected: its digit doesn't match ([a-z]+\.)*, and a test covers it.

Kept from #64

  • isV3URL accepts TBv3 on app.<env>. After the switch, TBv3's Classic link (to app.v2) sends referrer=https://app.<env>/?auth=true.
  • The fixed auth=true check in isRedirectingToLoginViaReferrer.

Checks

  • node --test src/common/__tests__/env.test.js src/common/__tests__/announcement.test.js: 26 pass. CI eslint is clean.

🤖 Generated with Claude Code

… the app.classic mapping

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@snyaggarwal

Copy link
Copy Markdown
Contributor Author

Review and merge verdict: ready to merge

No blockers and no should-fixes. CI is green (eslint, CodeQL), and locally 26 tests pass.

  • No app.classic left in src. env.js matches the version before OpenConceptLab/ocl_online#327 | TBv2 at app.classic.<env> names the same environment as app.<env> #64, apart from the added isTBv3URL and one comment line. toAppOrigin maps app.v2. only again.
  • getEnv:
    • app.v2 → production / '';
    • app.v2.dev → dev;
    • app.v2.staging.who → staging-who / staging.who, the same as app.staging.who.
  • The sign-in fixes from OpenConceptLab/ocl_online#327 | TBv2 at app.classic.<env> names the same environment as app.<env> #64 are intact. isV3URL delegates to isTBv3URL, and the isRedirectingToLoginViaReferrer fix is unchanged.
  • isTBv3URL:
    • Accepts app[.<env>] and app.v3[.<env>], including staging.who, with paths, queries and hashes.
    • Rejects app.v2[.<env>] (including app.v2.staging.who), http, explicit ports and look-alikes (@evil, .evil.com suffixes, orgx, a URL only containing ?x=https://app…).
  • The referrer TBv3 actually builds: ?referrer=https://app[.<env>].openconceptlab.org/?auth=true triggers the login redirect. Without auth=true, or from app.v2, it doesn't. forceLoginUser parses it the same way.

Nits (optional):

  1. No test for app.v2.staging.who, in either the getEnv or the isTBv3URL tests. It behaves correctly today, and it's the only two-label env, so it's the case most likely to break on a regex edit.
  2. isTBv3URL rejects app.v2 only because of its digit. A future letters-only TBv2 alias would count as TBv3, so it would need adding to the exclusion.

🤖 Generated with Claude Code

@snyaggarwal
snyaggarwal merged commit 4b9786f into master Dec 1, 2026
6 checks passed
@snyaggarwal
snyaggarwal deleted the ocl_online-327-app-v2-only branch December 1, 2026 09:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant