krisanalfa / lumen-jwt

Lumen with JWT Authentication, Dingo API and CORS Support
258 stars 80 forks source link

error: token_invalid #9

Closed j-quelly closed 7 years ago

j-quelly commented 7 years ago

Using Postman I authenticate John Doe:

http://websiteprogress.ca/uploads/20161025191157444.png

That works fine, but when I try to check the authenticated user by passing the token as a parameter:

http://websiteprogress.ca/uploads/20161025191453612.png

or via the header:

http://websiteprogress.ca/uploads/20161025191416698.png

I get an error: token_invalid.

Am I do something wrong?

krisanalfa commented 7 years ago

Hi, first thing, how did you run the app? Is it via PHP built in server or anything else? Secondly, have you set your JWT_SECRET?

krisanalfa commented 7 years ago

I cannot reproduce your issue. But here's a list you may check:

j-quelly commented 7 years ago

Ahh yes, it seems I wrote JWT_TOKEN in my .env file instead of JWT_SECRET. oops!

Thank you for the help and great work by the way :)

krisanalfa commented 7 years ago

@studio174 glad to help you, sir