Skip to content

Commit dc3532e

Browse files
committed
fix: remove otp settings for service account app types
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent fd2a84a commit dc3532e

2 files changed

Lines changed: 16 additions & 10 deletions

File tree

resources/js/oauth2/profile/edit_client/actions.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,12 @@ const normalizeEntity = (entity, entitySection) => {
153153
normEntity.pkce_enabled = entity.pkce_enabled ? 1 : 0;
154154
normEntity = normalizePKCEDependencies(normEntity);
155155
}
156-
normEntity.otp_enabled = entity.otp_enabled ? 1 : 0;
157-
normEntity.otp_length = entity.otp_length;
158-
normEntity.otp_lifetime = entity.otp_lifetime;
156+
normEntity.otp_enabled = 0;
157+
if (entity.otp_enabled) {
158+
normEntity.otp_enabled = 1;
159+
normEntity.otp_length = entity.otp_length;
160+
normEntity.otp_lifetime = entity.otp_lifetime;
161+
}
159162

160163
if ([appTypes.JSClient, appTypes.Native, appTypes.WebApp].includes(entity.application_type))
161164
normEntity.max_allowed_user_sessions = entity.max_allowed_user_sessions;

resources/js/oauth2/profile/edit_client/components/security_settings_panel.js

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ const SecuritySettingsPanel = (
7171
onChange={handleUsePKCEChange}
7272
/>
7373
}
74-
<CheckboxFormControl
75-
id="otp_enabled"
76-
title="Use Passwordless?"
77-
tooltip="Use Passwordless Authentication"
78-
value={formik.values.otp_enabled}
79-
onChange={formik.handleChange}
80-
/>
74+
{
75+
[appTypes.JSClient, appTypes.Native, appTypes.WebApp].includes(application_type) &&
76+
<CheckboxFormControl
77+
id="otp_enabled"
78+
title="Use Passwordless?"
79+
tooltip="Use Passwordless Authentication"
80+
value={formik.values.otp_enabled}
81+
onChange={formik.handleChange}
82+
/>
83+
}
8184
{
8285
formik.values.otp_enabled &&
8386
<>

0 commit comments

Comments
 (0)