英文:
Laravel Fortify password reset link giving ArgumentCountError when clicked
问题
Using Laravel 9 和 Fortify,我可以通过电子邮件获得一个链接,该链接应该允许用户根据文档重置其密码。
This link has the form <origin>/api/reset-password?token=yadayada&email=abc@example.com
However the backend responds with an error:
local.ERROR: Illuminate\Routing\RouteFileRegistrar::{closure}()
函数参数太少,0个传递给了/home/dan/www/digisam/digisam-prm/vendor/laravel/framework/src/Illuminate/Routing/Route.php
在启动时传递给Fortify:resetPasswordView()的闭包从未被调用。
路由已经注册:
php artisan route:list
...
POST api/reset-password ..........//............. password.update # Laravel\Fortify # NewPasswordController@store
GET|HEAD api/reset-password ..........//............. password.reset
但在列表中,与POST不同,GET api没有列出控制器或方法。不太清楚原因,这是一个相当标准的Fortify安装。
下一步应该在哪里查找呢?
英文:
Using Laravel 9 and Fortify, I can get a link sent by email that should enable the user to reset their password, as per the docs.
This link has the form <origin>/api/reset-password?token=yadayada&email=abc@example.com
However the backend responds with an error:
local.ERROR: Too few arguments to function Illuminate\Routing\RouteFileRegistrar::{closure}(), 0 passed in /home/dan/www/digisam/digisam-prm/vendor/laravel/framework/src/Illuminate/Routing/Route.php
The closure passed to Fortify:resetPasswordView() at boot is never called.
The route is registered:
php artisan route:list
...
POST api/reset-password ..........//............. password.update # Laravel\Fortify # NewPasswordController@store
GET|HEAD api/reset-password ..........//............. password.reset
but in the list, no controller or method is listed for the GET api as opposed to the POST. Not sure why, this is a fairly vanilla Fortify installation.
Any ideas for where to look next?
答案1
得分: 0
在路由/api.php文件中的代码没有起作用。
英文:
Turned out to be code in route/api.php that was not functional.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论