Store JWT key in config file

- During config file creation, the generated JWT key will be stored.
- Added an option to disable this behavior.
This commit is contained in:
2026-03-04 14:58:35 +01:00
parent e066321468
commit 60c8f37257
3 changed files with 18 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ func getKeyVariableName() string {
return "PLM_JWT_KEY"
}
func InitKey(jwtkey string) error {
func InitKey(jwtkey string) (string, error) {
var err error
keyName := getKeyVariableName()
//ignore config value, look in env first
@@ -40,7 +40,7 @@ func InitKey(jwtkey string) error {
}
os.Setenv(keyName, key)
}
return err
return key, err
}
func GetJwtKey() ([]byte, error) {