freehaha / token-auth

token based authentication middleware for net/http
27 stars 7 forks source link

jwt example not running #2

Closed baijum closed 10 years ago

baijum commented 10 years ago

I tried to run the jwt example and got this error:

~/mygo/src/github.com/freehaha/token-auth/examples/jwt$ go run main.go 
# github.com/freehaha/token-auth/jwt
../../jwt/jwtstore.go:64: cannot use func literal (type func(*jwt.Token) (interface {}, error)) as type jwt.Keyfunc in argument to jwt.Parse

This is my gc version:

~/mygo/src/github.com/freehaha/token-auth/examples/jwt$ go version
go version go1.3.1 linux/amd64
freehaha commented 10 years ago

Hi, Thanks for reporting the issue. Unfortunately, I cannot reproduce this in my current environment but it might be caused by using an older version of github.com/dgrijalva/jwt-go could you try updating this package and then run the example again?

baijum commented 10 years ago

@freehaha I just updated jwt-go and it worked. Thanks!

freehaha commented 10 years ago

no worries.