Added test suites for all current models

This commit is contained in:
🐙PiperYxzzy
2022-05-01 20:49:03 +02:00
parent 5f85a5800e
commit 6e7b30be0a
12 changed files with 400 additions and 27 deletions

View File

@@ -16,7 +16,7 @@ type Admin struct {
const adminJwtDuration = time.Hour * 2
var adminHmac = util.GenerateHmac()
var AdminHmac = util.GenerateHmac()
func (a *Admin) GetJwt() (string, int) {
j := jwt.NewWithClaims(jwt.SigningMethodHS256, jwt.MapClaims{
@@ -26,7 +26,7 @@ func (a *Admin) GetJwt() (string, int) {
"role": "admin",
})
jstr, err := j.SignedString(adminHmac)
jstr, err := j.SignedString(AdminHmac)
if err != nil {
// we should ALWAYS be able to build and sign a str
panic(err)