Closed tomriddle1234 closed 1 year ago
Solved this issue, I was using my old code that there's no initiation for gin-jwt jwt.GinJWTMiddleware, after added
authNormalUserMiddleware, err := jwt.New(&jwt.GinJWTMiddleware{
...
})
if err != nil {
log.Fatal("JWT Error:" + err.Error())
}
// When you use jwt.New(), the function is already automatically called for checking,
// which means you don't need to call it again.
errInit := authNormalUserMiddleware.MiddlewareInit()
if errInit != nil {
log.Fatal("authNormalUserMiddleware.MiddlewareInit() Error:" + errInit.Error())
}
The issue is gone.
Here's the error message, seems it is from system? v2.8.0, gin 1.8.1, go 1.18.1, ubuntu 20.04 64 virtual machine.
The problem seems for my own code it is from the Authenticator, like so, followed the example
From the error message, error from the LoginHander, like so