From 648ab503174e75652c6f95bb64d2d5cb944aaba2 Mon Sep 17 00:00:00 2001 From: romanetar Date: Thu, 3 Apr 2025 21:06:44 +0200 Subject: [PATCH] fix: validation based on app type Signed-off-by: romanetar --- resources/js/oauth2/profile/edit_client/actions.js | 6 +++++- resources/views/oauth2/profile/edit-client.blade.php | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/resources/js/oauth2/profile/edit_client/actions.js b/resources/js/oauth2/profile/edit_client/actions.js index f704b4fd..dc33310a 100644 --- a/resources/js/oauth2/profile/edit_client/actions.js +++ b/resources/js/oauth2/profile/edit_client/actions.js @@ -101,6 +101,7 @@ const normalizePKCEDependencies = (entity) => { const normalizeEntity = (entity, entitySection) => { let normEntity = {}; const clientTypes = window.CLIENT_TYPES; + const appTypes = window.APP_TYPES; normEntity.application_type = entity.application_type; @@ -155,7 +156,10 @@ const normalizeEntity = (entity, entitySection) => { normEntity.otp_enabled = entity.otp_enabled ? 1 : 0; normEntity.otp_length = entity.otp_length; normEntity.otp_lifetime = entity.otp_lifetime; - normEntity.max_allowed_user_sessions = entity.max_allowed_user_sessions; + + if ([appTypes.JSClient, appTypes.Native, appTypes.WebApp].includes(entity.application_type)) + normEntity.max_allowed_user_sessions = entity.max_allowed_user_sessions; + normEntity.default_max_age = entity.default_max_age; normEntity.token_endpoint_auth_signing_alg = entity.token_endpoint_auth_signing_alg; normEntity.token_endpoint_auth_method = entity.token_endpoint_auth_method; diff --git a/resources/views/oauth2/profile/edit-client.blade.php b/resources/views/oauth2/profile/edit-client.blade.php index c597d06a..4a832299 100644 --- a/resources/views/oauth2/profile/edit-client.blade.php +++ b/resources/views/oauth2/profile/edit-client.blade.php @@ -99,6 +99,7 @@ userName: '{{ Session::has('username') ? Session::get('username') : ""}}', } + window.APP_TYPES = appTypes; window.CLIENT_TYPES = clientTypes; window.CSFR_TOKEN = document.head.querySelector('meta[name="csrf-token"]').content;