Skip to content

Commit 4b25e89

Browse files
committed
fix: env decryption
1 parent 136eda1 commit 4b25e89

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/env/persist_env.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package env
22

33
import (
44
"encoding/json"
5+
"fmt"
56
"log"
67
"os"
78
"strconv"
@@ -80,9 +81,16 @@ func PersistEnv() error {
8081
return err
8182
}
8283

84+
fmt.Println("decryptedEncryptionKey:", decryptedEncryptionKey)
85+
8386
envstore.EnvStoreObj.UpdateEnvVariable(constants.StringStoreIdentifier, constants.EnvKeyEncryptionKey, decryptedEncryptionKey)
8487

85-
decryptedConfigs, err := crypto.DecryptAESEnv([]byte(env.EnvData))
88+
b64DecryptedConfig, err := crypto.DecryptB64(env.EnvData)
89+
if err != nil {
90+
return err
91+
}
92+
93+
decryptedConfigs, err := crypto.DecryptAESEnv([]byte(b64DecryptedConfig))
8694
if err != nil {
8795
return err
8896
}

0 commit comments

Comments
 (0)