Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on getting userinfo #1

Open
gustavosooeiro opened this issue Jun 27, 2017 · 6 comments
Open

Error on getting userinfo #1

gustavosooeiro opened this issue Jun 27, 2017 · 6 comments

Comments

@gustavosooeiro
Copy link

Hi,

I've just downloaded your code to learn about go and jwt. When trying to access the userinfo api i received a message, that I could not figure what is the problem. I hope you can help me undestand:

[negroni] PANIC: interface conversion: interface {} is nil, not *jwt.Token

@markcheno
Copy link
Owner

/api/users/info is a protected route. It sounds like you are trying to access with endpoint without a token. You must login an existing user or create a new one. Both actions will return a token that can be used to access protected routes. Try following the instructions in the readme. You must first start the Go server backend. For the frontend you can either create a production build or run a separate development server. Then access the web site with your browser. Hope that helps.

@gustavosooeiro
Copy link
Author

I did everything you just said Mark. I was logged in. I've got this error just trying to access the route, when clicked in the user info menu link. So, as I am logged in, the problem must be that there somewhere in the code the token is not been passed correctly. I just cant say where exactly. Can you tell? I haven't changed anything in your code!

@markcheno
Copy link
Owner

I believe it is fixed now. Please pull the latest code and try again. The problem was an update to the jwt middleware software I used.

@gustavosooeiro
Copy link
Author

Still the same error :(

@markcheno
Copy link
Owner

I'm sorry, without more information, I can't tell what the problem is. I was able to duplicate your error, but it is now fixed for me. Perhaps try a "go get -u ./..." in the project root. Then restart everything.

@blogscot
Copy link

blogscot commented Apr 24, 2019

I've seen this exact same issue. In my case, I'd used go modules to pull down the dependencies. After much debugging I eventually discovered that the version of JWT middleware I was using wasn't the latest! I had somehow managed to grab a version from 2016-04

v0.0.0-20160421215738-f3f7de3b9e39

After coaxing go modules to get the latest version from 2017-04

v0.0.0-20170425171159-5493cabe49f7

the problem I was having with getting userinfo was resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants