summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/web/cookie.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkg/web/cookie.go b/pkg/web/cookie.go
index 0c39735..7a2426f 100644
--- a/pkg/web/cookie.go
+++ b/pkg/web/cookie.go
@@ -9,11 +9,13 @@ import (
"github.com/xlgmokha/x/pkg/cookie"
"github.com/xlgmokha/x/pkg/crypt"
+ "github.com/xlgmokha/x/pkg/env"
"github.com/xlgmokha/x/pkg/pls"
"github.com/xlgmokha/x/pkg/x"
)
-var key []byte = x.Must(pls.GenerateRandomBytes(32)) // TODO:: https://gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/-/issues/2
+// TODO:: https://gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/-/issues/2
+var key []byte = []byte(env.Fetch("HMAC_SESSION_SECRET", string(x.Must(pls.GenerateRandomBytes(32)))))
var Signer *crypt.HMACSigner = x.New[*crypt.HMACSigner](crypt.WithKey(key), crypt.WithAlgorithm(sha256.New))
var delimiter string = "--"