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:
1 parent
d1c31e0fd4
commit
6db02148ea
3 files changed
+57
-2
No files matched your search
@@ -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