Skip to content

Commit 481c66d

Browse files
waleedlatif1claude
andcommitted
fix(auth): guard trusted SSO providers with isSsoEnabled (isTruthy)
env.SSO_ENABLED can be the string "false" (t3-env returns strings for booleans), which is truthy in JS. Use the canonical isSsoEnabled flag (isTruthy(env.SSO_ENABLED)) so SSO_ENABLED="false"/"0" correctly yields an empty trusted-provider list, matching how SSO is gated elsewhere. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 45d5d64 commit 481c66d

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/sim/lib/auth/auth.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ import {
7171
isRegistrationDisabled,
7272
isSignupEmailValidationEnabled,
7373
isSignupMxValidationEnabled,
74+
isSsoEnabled,
7475
} from '@/lib/core/config/feature-flags'
7576
import { PlatformEvents } from '@/lib/core/telemetry'
7677
import { getBaseUrl, isLocalhostUrl, parseOriginList } from '@/lib/core/utils/urls'
@@ -172,7 +173,7 @@ const additionalTrustedOrigins = parseOriginList(env.TRUSTED_ORIGINS, (value) =>
172173
* Resolved once at startup; `trustEmailVerified` on the SSO plugin handles IdPs
173174
* that assert `email_verified` live, so this is only needed for IdPs that omit it.
174175
*/
175-
const additionalTrustedSsoProviders = env.SSO_ENABLED
176+
const additionalTrustedSsoProviders = isSsoEnabled
176177
? [env.SSO_PROVIDER_ID, ...(env.SSO_TRUSTED_PROVIDER_IDS?.split(',') ?? [])]
177178
.map((id) => id?.trim())
178179
.filter((id): id is string => Boolean(id))

0 commit comments

Comments
 (0)