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
This commit is contained in:
12
util/util.go
Normal file
12
util/util.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package util
|
||||
|
||||
import "crypto/rand"
|
||||
|
||||
func GenerateHmac() []byte {
|
||||
b := make([]byte, 64)
|
||||
if _, err := rand.Read(b); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return b
|
||||
}
|
||||
Reference in New Issue
Block a user