From 059a87a80227426f854256139bbbc7309bdb6fa0 Mon Sep 17 00:00:00 2001 From: mo khan Date: Mon, 28 Apr 2025 16:51:56 -0600 Subject: feat: redirect to login page when session is established --- pkg/pls/random.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 pkg/pls/random.go (limited to 'pkg/pls/random.go') diff --git a/pkg/pls/random.go b/pkg/pls/random.go new file mode 100644 index 0000000..f7935f1 --- /dev/null +++ b/pkg/pls/random.go @@ -0,0 +1,12 @@ +package pls + +import ( + "crypto/rand" + "encoding/hex" +) + +func GenerateRandomHex(length int) string { + nonceBytes := make([]byte, length) + rand.Read(nonceBytes) + return hex.EncodeToString(nonceBytes) +} -- cgit v1.2.3