fix: admin oauth2 provider JS alert

This commit is contained in:
oliverpool 2024-06-07 10:25:27 +02:00
parent 4e816e1326
commit 3efa4d836a

View file

@ -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');
}