Files
gin-gonic-prepack/util/util.go
🐙PiperYxzzy 6db02148ea Building and returning JWTs on login
* Created Util package for assorted items
* Currently generates an HMAC key on startup, to be changed
* JWT also includes login role
2022-04-30 16:30:07 +02:00

13 lines
158 B
Go

package util
import "crypto/rand"
func GenerateHmac() []byte {
b := make([]byte, 64)
if _, err := rand.Read(b); err != nil {
panic(err)
}
return b
}