You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 21, 2022. It is now read-only.
// Create the tokentoken:=jwt.New(jwt.GetSigningMethod("HS256"))
// Set some claimstoken.Claims["foo"] ="bar"token.Claims["exp"] =time.Now().Add(time.Hour*72).Unix()
// Sign and get the complete encoded token as a stringtokenString, err:=token.SignedString(mySigningKey)
go: finding module for package github.com/dgrijalva/jwt-go
go: downloading github.com/dgrijalva/jwt-go v1.0.2
go: downloading github.com/dgrijalva/jwt-go v3.2.0+incompatible
go: found github.com/dgrijalva/jwt-go in github.com/dgrijalva/jwt-go v3.2.0+incompatible
./prog.go:12:14: invalid operation: token.Claims["foo"] (type jwt.Claims does not support indexing)
The issue #388 (comment) helps to solve, but I think would be better if the example from documentation works too.
The text was updated successfully, but these errors were encountered:
victorabarros
changed the title
Create toke example doesn't works
Create token example doesn't works
Feb 23, 2021
It looks like the API changed several years ago, but none of the documentation has been updated since.
If anyone has examples for how the new API works, that's be super useful. I'm not sure if versions > 1.0.2 are considered usable though, maybe they're still experimental?
Hi guys!
I'm having some problem in try create token following:
The issue #388 (comment) helps to solve, but I think would be better if the example from documentation works too.
The text was updated successfully, but these errors were encountered: