Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUG] admin oauth2 source required check (#4194)
#4059 was unfortunately incomplete: some custom_url fields are currently shown, even if they are not used by the provider. Moreover the `Use Custom URLs Instead of Default URLs` is always checked by default. Manual testing: - go to http://localhost:3000/admin/auths - click on `Add authentication source` - Choose `Authentication type`: `OAuth2` - Choose `OAuth2 provider`: `GitLab` - verify that the `Use Custom URLs Instead of Default URLs` option is **initially unchecked** - enable the `Use Custom URLs Instead of Default URLs` checkbox - verify that only the fields "Authorize", "Token" and "Profile" URLs are shown (no "Email URL", nor "Tenant"). - Switch the `OAuth2 provider` to `Azure AD v2` - verify that the `Use Custom URLs Instead of Default URLs` option is **initially checked** - verify that only the field "Tenant" is shown (with the default "organizations"). ![image](/attachments/0e2b1508-861c-4b0e-ae6a-6eb24ce94911) Note: this is loosely based on the upstream fix go-gitea/gitea#31246 which I initially overlooked. Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/4194 Reviewed-by: Earl Warren <[email protected]> Co-authored-by: oliverpool <[email protected]> Co-committed-by: oliverpool <[email protected]> (cherry picked from commit 65f8c22)
- Loading branch information