Fix grabage codes 5 years ago

Signed-off-by: Asai Neko <sugar@sne.moe>
This commit is contained in:
2025-12-23 23:46:00 +08:00
parent b933522123
commit 485d0de64b
8 changed files with 21 additions and 44 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/gin-gonic/gin"
"github.com/golang-jwt/jwt/v5"
"github.com/google/uuid"
"github.com/spf13/viper"
)
func init() {
@@ -17,7 +18,7 @@ func init() {
}
func generateTestToken(userID uuid.UUID, expire time.Duration) string {
var JwtSecret = []byte(config.Get("server.jwt_secret").(string))
var JwtSecret = []byte(viper.GetString("server.jwt_secret"))
claims := Claims{
UserID: userID,
RegisteredClaims: jwt.RegisteredClaims{