I am trying to extract claims inside the Authenticator, to perform certain operations right after successful authentication - Login.
However I am getting empty claims everytime I extract them using the Extractclaims() method.
However I get the proper claim values in the Authorizatior.
Authenticator: func(c *gin.Context) (interface{}, error) {
claims := jwt.ExtractClaims(c)
fmt.Println(claims["id"].(string))
}
I get nil for claim value inside authenticator.
Authorizator: func(data interface{}, c *gin.Context) bool {
claims := jwt.ExtractClaims(c)
fmt.Println(claims["id"].(string))
},
I am getting the Id when using with Authorizatior.
Also the context body is right.
What am I missing?