Auth Source: oAuth2 > gitlab > Custom URL: display problem #6961

Open
opened 2025-11-02 07:12:12 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @yurenchen000 on GitHub (Mar 3, 2021).

  • Gitea version (or commit ref): 1.11.4 and 1.13.2 (both from TURNKEY gitea 16)

  • Git version:

  • Operating system: Debian10 // it's turnkey-gitea-16.1-buster-amd64

  • Database (use [x]):

    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:

    • Yes (provide example URL)
    • No // No Admin Permission
  • Log gist:

Description

// Encountered Situation
Set custom url value Success,
But always display default value.

// Little Dig
the setting value of URL is right, on input attribute['value'], but this not disaply on ui. (not input.value)
the INPUT element still display default value here.

and the mysql select * from login_source; is right,
it's a web frontend problem ?

https://github.com/go-gitea/gitea/blob/release/v1.13/templates/admin/auth/edit.tmpl#L228

Screenshots

gitea_auth_source_



my temp workaround, chrome F12 run:

[oauth2_auth_url, oauth2_token_url, oauth2_profile_url].forEach(o=> o.value=o.getAttribute('value'))

temp workaround use .tmpl

vi /home/git/custom/templates/custom/footer.tmpl

append custom script, restart gitea: systemctl status gitea.service.

<script>
// only fix gitlab oAuth elements display
document.body.onload = function(){
        // console.log(' == body.onload')
        // patch for auths input value
        if (location.pathname.startsWith('/admin/auths/')) {
                setTimeout(function(){
                [oauth2_auth_url, oauth2_token_url, oauth2_profile_url].forEach(o=> o.value=o.getAttribute('value'))
                //[oauth2_auth_url, oauth2_token_url, oauth2_profile_url].forEach(o=> $(o).val(o.attr('value')))
                }, 1)
        }
}
</script>
Originally created by @yurenchen000 on GitHub (Mar 3, 2021). <!-- NOTE: If your issue is a security concern, please send an email to security@gitea.io instead of opening a public issue --> <!-- 1. Please speak English, this is the language all maintainers can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/gitea) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Make sure it's not mentioned in the FAQ (https://docs.gitea.io/en-us/faq) 5. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> - Gitea version (or commit ref): 1.11.4 and 1.13.2 (both from TURNKEY gitea 16) - Git version: - Operating system: Debian10 // it's [turnkey-gitea-16.1-buster-amd64](https://releases.turnkeylinux.org/turnkey-gitea/16.1-buster-amd64/) <!-- Please include information on whether you built gitea yourself, used one of our downloads or are using some other package --> <!-- Please also tell us how you are running gitea, e.g. if it is being run from docker, a command-line, systemd etc. ---> <!-- If you are using a package or systemd tell us what distribution you are using --> - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] MSSQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No // No Admin Permission - Log gist: <!-- It really is important to provide pertinent logs --> <!-- Please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems --> <!-- In addition, if your problem relates to git commands set `RUN_MODE=dev` at the top of app.ini --> ## Description <!-- If using a proxy or a CDN (e.g. CloudFlare) in front of gitea, please disable the proxy/CDN fully and connect to gitea directly to confirm the issue still persists without those services. --> // Encountered Situation Set custom url value Success, But always display default value. // Little Dig the setting value of URL is right, on input attribute['value'], but this not disaply on ui. (not input.value) the INPUT element still display default value here. and the mysql `select * from login_source;` is right, it's a web frontend problem ? https://github.com/go-gitea/gitea/blob/release/v1.13/templates/admin/auth/edit.tmpl#L228 ## Screenshots ![gitea_auth_source_](https://user-images.githubusercontent.com/8458213/109848509-539c9080-7c8b-11eb-82ec-456bebcaaa98.png) <!-- **If this issue involves the Web Interface, please include a screenshot** --> <br><br> ---- my temp workaround, chrome F12 run: ```javascript [oauth2_auth_url, oauth2_token_url, oauth2_profile_url].forEach(o=> o.value=o.getAttribute('value')) ``` ## temp workaround use .tmpl vi /home/git/custom/templates/custom/footer.tmpl append custom script, restart gitea: `systemctl status gitea.service`. ```html <script> // only fix gitlab oAuth elements display document.body.onload = function(){ // console.log(' == body.onload') // patch for auths input value if (location.pathname.startsWith('/admin/auths/')) { setTimeout(function(){ [oauth2_auth_url, oauth2_token_url, oauth2_profile_url].forEach(o=> o.value=o.getAttribute('value')) //[oauth2_auth_url, oauth2_token_url, oauth2_profile_url].forEach(o=> $(o).val(o.attr('value'))) }, 1) } } </script> ```
GiteaMirror added the topic/uitype/bug labels 2025-11-02 07:12:12 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#6961