Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't init oauth if settings have it disabled #31533

Closed
wants to merge 3 commits into from

Conversation

techknowlogick
Copy link
Member

Fix #30266

Patch credit to: @hawicz

@techknowlogick techknowlogick added the backport/v1.22 This PR should be backported to Gitea 1.22 label Jul 1, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jul 1, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jul 1, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Jul 1, 2024
…is it is possible to have suprious jwt/ directories all over the place
services/auth/source/oauth2/init.go Outdated Show resolved Hide resolved
services/auth/source/oauth2/init.go Outdated Show resolved Hide resolved
Co-authored-by: delvh <dev.lh@web.de>
@@ -30,6 +30,11 @@ const ProviderHeaderKey = "gitea-oauth2-provider"

// Init initializes the oauth source
func Init(ctx context.Context) error {
// if oauth is disabled, we don't need to initialize anything
if !setting.OAuth2.Enabled {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not right because line 43 and below code should be invoked even if Oauth2 provider doesn't enabled.

lunny added a commit that referenced this pull request Oct 2, 2024
…es/files (#32148)

Fix #30266
Replace #31533
@lunny lunny closed this Oct 2, 2024
@lunny lunny removed the backport/v1.22 This PR should be backported to Gitea 1.22 label Oct 2, 2024
@techknowlogick techknowlogick deleted the fix-30266 branch October 2, 2024 01:32
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. modifies/go Pull requests that update Go code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

loadOrCreateAsymmetricKey called when oauth2 is disabled
6 participants