Skip to content

Commit 40e650a

Browse files
waleedlatif1claude
andcommitted
fix(okta): use nullish coalescing for boolean switch defaults
Block now forwards sendEmail/activate values as-is (including false). Tools use ?? operator so: explicit true/false from switches are respected, undefined (programmatic calls) still defaults to true. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent ed0ee87 commit 40e650a

File tree

4 files changed

+3
-9
lines changed

4 files changed

+3
-9
lines changed

apps/sim/blocks/blocks/okta.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,6 @@ export const OktaBlock: BlockConfig<OktaResponse> = {
291291
if (params.groupName) result.name = params.groupName
292292
if (params.groupDescription) result.description = params.groupDescription
293293

294-
// Boolean switches: only forward when explicitly true so tool defaults apply when OFF
295-
if (params.sendEmail === true) result.sendEmail = true
296-
if (params.activate === true) result.activate = true
297-
298294
// Pass through all other non-empty params
299295
const skipKeys = new Set([
300296
'operation',
@@ -303,8 +299,6 @@ export const OktaBlock: BlockConfig<OktaResponse> = {
303299
'limit',
304300
'groupName',
305301
'groupDescription',
306-
'sendEmail',
307-
'activate',
308302
])
309303
for (const [key, value] of Object.entries(params)) {
310304
if (!skipKeys.has(key) && value !== undefined && value !== null && value !== '') {

apps/sim/tools/okta/activate_user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const oktaActivateUserTool: ToolConfig<OktaActivateUserParams, OktaActiva
4646
request: {
4747
url: (params) => {
4848
const domain = validateOktaDomain(params.domain)
49-
const sendEmail = params.sendEmail !== false
49+
const sendEmail = params.sendEmail ?? true
5050
return `https://${domain}/api/v1/users/${encodeURIComponent(params.userId)}/lifecycle/activate?sendEmail=${sendEmail}`
5151
},
5252
method: 'POST',

apps/sim/tools/okta/create_user.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export const oktaCreateUserTool: ToolConfig<OktaCreateUserParams, OktaCreateUser
8888
request: {
8989
url: (params) => {
9090
const domain = validateOktaDomain(params.domain)
91-
const activate = params.activate !== false
91+
const activate = params.activate ?? true
9292
return `https://${domain}/api/v1/users?activate=${activate}`
9393
},
9494
method: 'POST',

apps/sim/tools/okta/reset_password.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export const oktaResetPasswordTool: ToolConfig<OktaResetPasswordParams, OktaRese
4747
request: {
4848
url: (params) => {
4949
const domain = validateOktaDomain(params.domain)
50-
const sendEmail = params.sendEmail !== false
50+
const sendEmail = params.sendEmail ?? true
5151
return `https://${domain}/api/v1/users/${encodeURIComponent(params.userId)}/lifecycle/reset_password?sendEmail=${sendEmail}`
5252
},
5353
method: 'POST',

0 commit comments

Comments
 (0)