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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user