I am getting the following error when using my api in Postman, the error is that it tells me that the conversion of jwt.claims is jwt.mapClaims, the problem is that I do not know how to make the change … my code is … .
if token.Valid {
ctx: = context.WithValue (r.Context (), "user", token.Claims. (* models.Claim) .User)
next (w, r.WithContext (ctx))
}
the error is probably in token.Claims. (* models.Claim) .User), but I do not know how to convert it to mapClaims.
someone who can give me some help? How to implement it?
The panic text it’s only that, I use jwt-go, negroni, and one package that I create by myself. So, I can send the panic text, is not a problem, I will let you here. Wait a moment.
It expects a pointer to jwt.mapClaims. that is *jwt.mapClaims but you gives it just a jwt.mapClaims. read up on pointers here: https://www.golang-book.com/books/intro/8
I understand that, but I don’t know how must I pass the claims with *jwt.MapClaims as Pointer, I already use the *jwt.mapClaims but is not working. Maybe I am using in bad way.