Laravel Passport通过网络发布使用自己的API

时间:2018-09-13 15:42:15

标签: php laravel api axios laravel-passport

我正在运行laravel 5.6应用程序,直到今天一切都很好。

我运行composer update进行了一些修复,结果出了问题。

通过X-CRSF-TOKEN进行的护照身份验证不再起作用。

通过axios查看以下典型的api调用,我可以确定一切正常。

Accept: application/json, text/plain, */*
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Cache-Control: no-cache
Connection: keep-alive  
Cookie:remember_web_59ba36addc2b2f9401580f014c7f58ea4e30989d=eyJpdiI6IjVBc2hRaFlqQnhoSEREQ1RHU0NROHc9PSIsInZhbHVlIjoiNEFqYTRScklzK0VReHl4SWV2V2x6Y0g3SVR0NGo0enhRcVVWbGJ4cm5ubGRwXC85Q2VuVE9EVGxnZTBGRm9cLytnSEpsYVptV0x4Nk8wYnZ2bWFsK2dDODRGTmk2TDk5K0hFSjZuR2k1ZTdlXC9tclNKUmxncVd0U29yZUpUNWxRNDZcL3VDcmFwbjdVRzl1WnczSGN6bnpcLzc4Z0s0cTBTXC80MXIzeVJNZ1krNjhVPSIsIm1hYyI6ImQ5ZWRjZGRhNGMwNTcwYTMzNGI0NTE4YzZmNzQzNDE4YjJlMzU4YTU4OTQ1YWNjMDcyNmU1OTc3ZjAzNGE1YmYifQ%3D%3D; laravel_token=eyJpdiI6IkZkeTcxWURBVk1Ea1F1YUlNRUFmU0E9PSIsInZhbHVlIjoiUWtJMVpZNkNaRWtRa0U1YU1TUXZyS0JZa1F6UlcwbjhmWkV3MXF5Mzh1TkhDRFwvZnpzTVJGend3YVRLTGFSN1ZadVcxb0tRRWRVXC90dnpwUVNGUHBXWE5MbXFRUEk1em02dXh5dnZqSzgxSjB0Wnp6N2RiSVFJenpTUUxqMEU0WHRNTE5KV1g5Q3EybzJRV0NpKzV5SmlLXC9FaDZEaGx1bGozb1pnN3R0ZjZSOVZVTDZTcGdYSnJibjUwdVhXdlBkN0xQaEhNMVU3enpwUnoxUWVndXYwVGJYUCtZQXRvK281cUlOc0Zxc0pzaEN4dmpXZ0VIZURiZUs5WDZGK0tBSCIsIm1hYyI6ImM2OGUwOTMxNTM0NzNiN2VlZTNjMzhkOGExYmE4N2ZjN2M0ZTM0ZTBmZjlkYzdlMTA1ZjQ5MjdiMWY4MzEyNDEifQ%3D%3D; XSRF-TOKEN=eyJpdiI6Ims5bFc3OFBMWmM0ZlFwQVZtODZlc1E9PSIsInZhbHVlIjoiRnBzZ25VQkNuaUM2Z0NwMDMyQ3g5aGdsNk5hM1NXdUl2a2J3VExrRUpMSVBzTFwvMzNjT2U0Q2liQnUrQVNIaUYiLCJtYWMiOiJiNjk0ZjFlZjgxYTkxMjhhNjYwNWU2ZGMwOTQyZDhjYWViZjBiNDk2MTY4OTM2ZjE5ZmZkZTllMWNmZDQ2NzJlIn0%3D;aposhashamura_session=eyJpdiI6ImhTakR5S0dsXC9zbyt5M0JycFg0eVdnPT0iLCJ2YWx1ZSI6IndEUkp0N0dGWWRGVEFUQVVlOWZ5VnYyQ0ZHUk1cLzhUbHlnZVJSM21YSVFSS0xUXC9BaTBqeTJrRkZiV0RqdzhIVCIsIm1hYyI6IjFlZGJlYzE4MDEzOTIyNTAxYWYxNzE5N2VhNzExY2M5ZWZlNWM4ZWZkNDM4OTE3NzEzOTRjYWQxZWFmMzI5OGYifQ%3D%3D
Host: somewhereonmymachine.my
Pragma: no-cache
Referer: http://somewhereonmymachine.my/backoffice/reports/admin
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.92 Safari/537.36
X-CSRF-TOKEN: rzLjJ0tIqo1he0k9wxypE8O685iLjmpEuRNFtP7C
X-Requested-With: XMLHttpRequest
X-Socket-Id: 125019.15490345
X-XSRF-TOKEN: eyJpdiI6Ims5bFc3OFBMWmM0ZlFwQVZtODZlc1E9PSIsInZhbHVlIjoiRnBzZ25VQkNuaUM2Z0NwMDMyQ3g5aGdsNk5hM1NXdUl2a2J3VExrRUpMSVBzTFwvMzNjT2U0Q2liQnUrQVNIaUYiLCJtYWMiOiJiNjk0ZjFlZjgxYTkxMjhhNjYwNWU2ZGMwOTQyZDhjYWViZjBiNDk2MTY4OTM2ZjE5ZmZkZTllMWNmZDQ2NzJlIn0=

我做了很多谷歌搜索,但似乎无法弄清楚这些问题。

\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class一直是$middlewareGroupsapp/Http/Kernel.php的最后一个条目

一个人吗?

1 个答案:

答案 0 :(得分:-1)

如果每个人都遇到此问题,请在更新后尝试回滚更新,或仅运行php artisan key:generate

那应该解决它。