add golang backend for login an d webserver

This commit is contained in:
Adrian Zürcher
2025-05-28 21:48:30 +02:00
parent c8b27813ae
commit 8cfb720c42
15 changed files with 761 additions and 0 deletions

14
backend/utils/secret.go Normal file
View File

@@ -0,0 +1,14 @@
package utils
import (
"crypto/rand"
)
func GenerateJWTSecret(length int) ([]byte, error) {
bytes := make([]byte, length)
_, err := rand.Read(bytes)
if err != nil {
return nil, err
}
return bytes, nil
}