fix invalid key expecting bytes instead of string

This commit is contained in:
2022-07-22 22:19:52 -04:00
parent 4b26d6f0a5
commit ddc3ffe488

View File

@@ -24,7 +24,7 @@ func GenerateJWT(email string, username string) (tokenString string, err error)
},
}
token := jwt.NewWithClaims(jwt.SigningMethodHS256, claims)
tokenString, err = token.SignedString(os.Getenv("JWT_SECRET"))
tokenString, err = token.SignedString([]byte(os.Getenv("JWT_SECRET")))
return
}