From 3efa4d836a300dc45b3ffece766b2b13539fc47c Mon Sep 17 00:00:00 2001 From: oliverpool Date: Fri, 7 Jun 2024 10:25:27 +0200 Subject: [PATCH] fix: admin oauth2 provider JS alert --- web_src/js/features/admin/common.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/web_src/js/features/admin/common.js b/web_src/js/features/admin/common.js index 9b7b81db04..c2f3cde821 100644 --- a/web_src/js/features/admin/common.js +++ b/web_src/js/features/admin/common.js @@ -98,11 +98,12 @@ export function initAdminCommon() { if (document.getElementById('oauth2_use_custom_url')?.checked) { for (const custom of ['token_url', 'auth_url', 'profile_url', 'email_url', 'tenant']) { - if (applyDefaultValues) { - document.getElementById(`oauth2_${custom}`).value = document.getElementById(`${provider}_${custom}`).value; - } const customInput = document.getElementById(`${provider}_${custom}`); - if (customInput && customInput.getAttribute('data-available')) { + if (!customInput) continue; + if (applyDefaultValues) { + document.getElementById(`oauth2_${custom}`).value = customInput.value; + } + if (customInput.getAttribute('data-available')) { for (const input of document.querySelectorAll(`.oauth2_${custom} input`)) { input.setAttribute('required', 'required'); }