1
0
Fork 0
forked from forgejo/forgejo

Do not prepare oauth2 config if it is not enabled, do not write config in some sub-commands (#25567) (#25576)

Backport #25567

Ref:

* https://github.com/go-gitea/gitea/issues/25377#issuecomment-1609757289

And some sub-commands like "generate" / "docs", they do not need to use
the ini config
This commit is contained in:
wxiaoguang 2023-06-29 12:30:40 +08:00 committed by GitHub
parent 8981f6d0fc
commit e6f62eea70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 10 deletions

View file

@ -116,6 +116,10 @@ func loadOAuth2From(rootCfg ConfigProvider) {
return
}
if !OAuth2.Enable {
return
}
if !filepath.IsAbs(OAuth2.JWTSigningPrivateKeyFile) {
OAuth2.JWTSigningPrivateKeyFile = filepath.Join(AppDataPath, OAuth2.JWTSigningPrivateKeyFile)
}