Skip to content

Commit c32d14c

Browse files
committed
fix(webapp): tolerate missing LOGIN_ORIGIN in isCloud
Test suites mock the env module with partial objects and import this module transitively, so the preview-host check must not assume the variable is set even though the schema gives it a default.
1 parent c651b2c commit c32d14c

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/webapp/app/services/platform.v3.server.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1140,7 +1140,9 @@ export function isCloud(): boolean {
11401140
// PR preview environments are cloud-style installs running against the
11411141
// cloud's staging services. Without this, anything gated on the billing
11421142
// client silently no-ops there (e.g. remote builds never get enqueued).
1143-
if (env.LOGIN_ORIGIN.endsWith(".triggerlabs.dev")) {
1143+
// Optional chaining: LOGIN_ORIGIN has a schema default, but test suites mock
1144+
// ~/env.server with partial objects and import this module transitively.
1145+
if (env.LOGIN_ORIGIN?.endsWith(".triggerlabs.dev")) {
11441146
return true;
11451147
}
11461148

0 commit comments

Comments
 (0)