diff options
author | Clar Fon <15850505+clarfonthey@users.noreply.github.com> | 2022-10-01 13:26:33 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-02 01:26:33 +0800 |
commit | 3d10193be2b4476d1d0d3249a9884fcc0faa64e5 (patch) | |
tree | a94e7a09e276682f28955fcaa515d9a096254df4 /services/auth | |
parent | 04e97b83115e7439d43c0ede5fe2d1b50d201c52 (diff) | |
download | gitea-3d10193be2b4476d1d0d3249a9884fcc0faa64e5.tar.gz gitea-3d10193be2b4476d1d0d3249a9884fcc0faa64e5.zip |
Allow specifying SECRET_KEY_URI, similar to INTERNAL_TOKEN_URI (#19663)
Only load SECRET_KEY and INTERNAL_TOKEN if they exist.
Never write the config file if the keys do not exist, which was only a fallback for Gitea upgraded from < 1.5
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'services/auth')
-rw-r--r-- | services/auth/source/oauth2/jwtsigningkey.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/services/auth/source/oauth2/jwtsigningkey.go b/services/auth/source/oauth2/jwtsigningkey.go index d6b3c05a4f..d9312ee820 100644 --- a/services/auth/source/oauth2/jwtsigningkey.go +++ b/services/auth/source/oauth2/jwtsigningkey.go @@ -364,7 +364,7 @@ func loadOrCreateSymmetricKey() (interface{}, error) { return nil, err } - setting.CreateOrAppendToCustomConf(func(cfg *ini.File) { + setting.CreateOrAppendToCustomConf("oauth2.JWT_SECRET", func(cfg *ini.File) { secretBase64 := base64.RawURLEncoding.EncodeToString(key) cfg.Section("oauth2").Key("JWT_SECRET").SetValue(secretBase64) }) |