loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ui): only run auth_name code on new and edit page (#7470)

- Only run the dynamic `auth_name` update code when its on the new or edit page. `.admin.authentication` also matches the main authentication screen which lead to a javascript error.
- Regression of forgejo/forgejo#7408

# Testing
1. Login as a admin.
2. Go to `/admin/auths`.
3. Notice no errors.
4. Go to `admin/auths/new`.
6. Select 'OAuth2' as authentication type.
5. Type some input into the 'Authentication name'.
6. Notice the the callback URL in the 'Tips' section including the authentication name.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7470
Reviewed-by: Michael Kriese <michael.kriese@gmx.de>
Co-authored-by: Gusted <postmaster@gusted.xyz>
Co-committed-by: Gusted <postmaster@gusted.xyz>

authored by

Gusted
Gusted
and committed by
Gusted
e6c17f31 b04bb28e

+1 -1
+1 -1
web_src/js/features/admin/common.js
··· 199 199 } 200 200 } 201 201 202 - if (document.querySelector('.admin.authentication')) { 202 + if (document.querySelector('.admin.edit.authentication, .admin.new.authentication')) { 203 203 const authNameEl = document.getElementById('auth_name'); 204 204 authNameEl.addEventListener('input', (el) => { 205 205 // appSubUrl is either empty or is a path that starts with `/` and doesn't have a trailing slash.