krisanalfa / lumen-jwt

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

MethodNotAllowedHttpException in RoutesRequests.php #1

Closed hopewise closed 8 years ago

hopewise commented 8 years ago

Hello @krisanalfa

I've reviewed the app.php, so, there were so many missing bootstrapping, thanks for the great work!

I could pass a token, and jwt.auth has worked, however, I got error when tried to /auth/login

MethodNotAllowedHttpException in RoutesRequests.php line 445:
in RoutesRequests.php line 445
at Application->handleDispatcherResponse(array('2', array('POST'))) in RoutesRequests.php line 381
at Application->Laravel\Lumen\Concerns\{closure}() in RoutesRequests.php line 624
at Application->sendThroughPipeline(array(), object(Closure)) in RoutesRequests.php line 382
at Application->dispatch(null) in RoutesRequests.php line 327
at Application->run() in index.php line 28

Mainly I will be using lumen for APIs, so I will not be logging into it, however its curiosity to know why its not working.. I think I have to dig more in the lumen& laravel architecture, do you know good resources links?

krisanalfa commented 8 years ago

Hi @hopewise. Which HTTP method did you use when you try to request a token? I used POST request. And it works fine.

curl -X "POST" "http://mylumenapp.local.dev/auth/login" \
     -H "Content-Type: application/x-www-form-urlencoded" \
     --data-urlencode "email=johndoe@example.com" \
     --data-urlencode "password=johndoe"

Nice response

Here's some good resource you may start with:

hopewise commented 8 years ago

Ah, OK, I used GET.. Thanks allot for the links.. On 9 Mar 2016 13:23, "Krisan Alfa Timur" notifications@github.com wrote:

Hi @hopewise https://github.com/hopewise. Which HTTP method did you use when you try to request a token? I used POST request. And it works fine.

curl -X "POST" "http://mylumenapp.local.dev/auth/login" \ -H "Content-Type: application/x-www-form-urlencoded" \ --data-urlencode "email=johndoe@example.com" \ --data-urlencode "password=johndoe"

[image: Nice response] https://cloud.githubusercontent.com/assets/3734729/13633808/f8b5123a-e623-11e5-89d5-6d637dd9ca56.png

Here's some good resource you may start with:

— Reply to this email directly or view it on GitHub https://github.com/krisanalfa/lumen-jwt/issues/1#issuecomment-194248636.

krisanalfa commented 8 years ago

You're very welcome sir.