mirror of
https://github.com/go-gitea/gitea
synced 2025-07-13 14:07:20 +00:00
Handle base64 decoding correctly to avoid panic (#26483)
Fix the panic if the "base64 secret" is too long.
This commit is contained in:
@ -70,12 +70,12 @@ func runGenerateInternalToken(c *cli.Context) error {
|
||||
}
|
||||
|
||||
func runGenerateLfsJwtSecret(c *cli.Context) error {
|
||||
JWTSecretBase64, err := generate.NewJwtSecretBase64()
|
||||
_, jwtSecretBase64, err := generate.NewJwtSecretBase64()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
fmt.Printf("%s", JWTSecretBase64)
|
||||
fmt.Printf("%s", jwtSecretBase64)
|
||||
|
||||
if isatty.IsTerminal(os.Stdout.Fd()) {
|
||||
fmt.Printf("\n")
|
||||
|
Reference in New Issue
Block a user