aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/auth
diff options
context:
space:
mode:
authorLeonardo Bishop <me@leonardobishop.net>2026-03-19 17:14:20 +0000
committerLeonardo Bishop <me@leonardobishop.net>2026-03-19 17:14:20 +0000
commit66bd5d2f7fd84eec39d69f4a8f5c435fc978804f (patch)
tree20bfd8637cce28750b4a66bdd9aa47cb9831308b /pkg/auth
parent60cd7875c2c9ee595012078a3ba8f13b71c73dc9 (diff)
Add site passwordsHEADmaster
Diffstat (limited to 'pkg/auth')
-rw-r--r--pkg/auth/provider.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/pkg/auth/provider.go b/pkg/auth/provider.go
index 0d515ab..e521c8c 100644
--- a/pkg/auth/provider.go
+++ b/pkg/auth/provider.go
@@ -1,6 +1,7 @@
package auth
import (
+ "crypto/rand"
"time"
"github.com/golang-jwt/jwt/v5"
@@ -11,9 +12,12 @@ type Authenticator struct {
parser *jwt.Parser
}
-func NewAuthenticator(secretKey []byte) *Authenticator {
+func NewAuthenticator() *Authenticator {
parser := jwt.NewParser(jwt.WithIssuer("scrapbook"), jwt.WithExpirationRequired())
+ secretKey := make([]byte, 32)
+ rand.Read(secretKey)
+
a := &Authenticator{
secretKey: secretKey,
parser: parser,