mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 06:03:51 +03:00
Merge pull request '[v7.0/forgejo] [BUG] admin oauth2 source required check' (#4195) from bp-v7.0/forgejo-65f8c22 into v7.0/forgejo
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4195 Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
commit
2b22c80738
3 changed files with 5 additions and 6 deletions
|
@ -1 +0,0 @@
|
|||
Wrongfully hidden "Use Custom URLs Instead of Default URLs" checkbox on Authentication Source Administration page.
|
1
release-notes/7.0.5/fix/4059.md
Normal file
1
release-notes/7.0.5/fix/4059.md
Normal file
|
@ -0,0 +1 @@
|
|||
Authentication Source Administration page wrongfully handled the "Custom URLs Instead of Default URLs" checkbox (missing checkbox, irrelevant fields) [#4059](https://codeberg.org/forgejo/forgejo/pulls/4059) [#4194](https://codeberg.org/forgejo/forgejo/pulls/4194)
|
|
@ -78,10 +78,9 @@ export function initAdminCommon() {
|
|||
default: {
|
||||
const customURLSettings = document.getElementById(`${provider}_customURLSettings`);
|
||||
if (!customURLSettings) break;
|
||||
if (customURLSettings.getAttribute('data-required')) {
|
||||
document.getElementById('oauth2_use_custom_url')?.setAttribute('checked', 'checked');
|
||||
}
|
||||
if (customURLSettings.getAttribute('data-available')) {
|
||||
const customURLRequired = (customURLSettings.getAttribute('data-required') === 'true');
|
||||
document.getElementById('oauth2_use_custom_url').checked = customURLRequired;
|
||||
if (customURLRequired || customURLSettings.getAttribute('data-available') === 'true') {
|
||||
showElem('.oauth2_use_custom_url');
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +102,7 @@ export function initAdminCommon() {
|
|||
if (applyDefaultValues) {
|
||||
document.getElementById(`oauth2_${custom}`).value = customInput.value;
|
||||
}
|
||||
if (customInput.getAttribute('data-available')) {
|
||||
if (customInput.getAttribute('data-available') === 'true') {
|
||||
for (const input of document.querySelectorAll(`.oauth2_${custom} input`)) {
|
||||
input.setAttribute('required', 'required');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue