Skip to content

Commit b697e26

Browse files
authored
fix: validation based on app type (#71)
Signed-off-by: romanetar <roman_ag@hotmail.com>
1 parent 180158c commit b697e26

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ const normalizePKCEDependencies = (entity) => {
101101
const normalizeEntity = (entity, entitySection) => {
102102
let normEntity = {};
103103
const clientTypes = window.CLIENT_TYPES;
104+
const appTypes = window.APP_TYPES;
104105

105106
normEntity.application_type = entity.application_type;
106107

@@ -155,7 +156,10 @@ const normalizeEntity = (entity, entitySection) => {
155156
normEntity.otp_enabled = entity.otp_enabled ? 1 : 0;
156157
normEntity.otp_length = entity.otp_length;
157158
normEntity.otp_lifetime = entity.otp_lifetime;
158-
normEntity.max_allowed_user_sessions = entity.max_allowed_user_sessions;
159+
160+
if ([appTypes.JSClient, appTypes.Native, appTypes.WebApp].includes(entity.application_type))
161+
normEntity.max_allowed_user_sessions = entity.max_allowed_user_sessions;
162+
159163
normEntity.default_max_age = entity.default_max_age;
160164
normEntity.token_endpoint_auth_signing_alg = entity.token_endpoint_auth_signing_alg;
161165
normEntity.token_endpoint_auth_method = entity.token_endpoint_auth_method;

resources/views/oauth2/profile/edit-client.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
userName: '{{ Session::has('username') ? Session::get('username') : ""}}',
100100
}
101101
102+
window.APP_TYPES = appTypes;
102103
window.CLIENT_TYPES = clientTypes;
103104
window.CSFR_TOKEN = document.head.querySelector('meta[name="csrf-token"]').content;
104105

0 commit comments

Comments
 (0)