aboutsummaryrefslogtreecommitdiffstats
path: root/routers/install/install.go
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2024-02-16 23:18:30 +0800
committerGitHub <noreply@github.com>2024-02-16 15:18:30 +0000
commit45c15387b292c25b5d0572b2eb3f85414156372a (patch)
treecb3052845543958872adcab501c87871502a525e /routers/install/install.go
parent7132a0ba75d6fe734d9f950f217a5ceb81375328 (diff)
downloadgitea-45c15387b292c25b5d0572b2eb3f85414156372a.tar.gz
gitea-45c15387b292c25b5d0572b2eb3f85414156372a.zip
Refactor JWT secret generating & decoding code (#29172)
Old code is not consistent for generating & decoding the JWT secrets. Now, the callers only need to use 2 consistent functions: NewJwtSecretWithBase64 and DecodeJwtSecretBase64 And remove a non-common function Base64FixedDecode from util.go
Diffstat (limited to 'routers/install/install.go')
-rw-r--r--routers/install/install.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/routers/install/install.go b/routers/install/install.go
index 5c0290d2cc..064575d34c 100644
--- a/routers/install/install.go
+++ b/routers/install/install.go
@@ -409,7 +409,7 @@ func SubmitInstall(ctx *context.Context) {
cfg.Section("server").Key("LFS_START_SERVER").SetValue("true")
cfg.Section("lfs").Key("PATH").SetValue(form.LFSRootPath)
var lfsJwtSecret string
- if _, lfsJwtSecret, err = generate.NewJwtSecretBase64(); err != nil {
+ if _, lfsJwtSecret, err = generate.NewJwtSecretWithBase64(); err != nil {
ctx.RenderWithErr(ctx.Tr("install.lfs_jwt_secret_failed", err), tplInstall, &form)
return
}