Laravel Fortify密码重置链接在点击时出现ArgumentCountError。

huangapple go评论64阅读模式
英文:

Laravel Fortify password reset link giving ArgumentCountError when clicked

问题

Using Laravel 9 和 Fortify,我可以通过电子邮件获得一个链接,该链接应该允许用户根据文档重置其密码。

This link has the form <origin>/api/reset-password?token=yadayada&amp;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.

huangapple
  • 本文由 发表于 2023年6月15日 16:14:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76480436.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定