【问题标题】:Password reset link in email is not found on server在服务器上找不到电子邮件中的密码重置链接
【发布时间】:2019-11-05 09:23:53
【问题描述】:

我只使用默认路由和默认功能对密码重置功能进行编码。我能够在邮件中收到密码重置链接,但链接不起作用。我收到 404 错误,在服务器上找不到请求的 url。

到目前为止,我正在我的本地主机上进行测试

尝试了不同的方法,我知道链接中提供的令牌与password_reset表中的令牌明显不匹配。只是没有线索去追逐这个。因为我不想自定义整个功能。

我也只在令牌过期之前尝试过。

我使用的基本路线是

Auth::routes(['verify' => true]); \
//Reset Passwords for candidates 
Route::get('password/reset', 'Auth\ForgotPasswordController@showLinkRequestForm')->name('password.request'); 
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.email'); 
Route::get('password/reset/{token}', 'Auth\ResetPasswordController@showResetForm')->name('password.reset'); 
Route::post('password/reset', 'Auth\ResetPasswordController@reset');

.env 文件中的 APP URL 是 APP_URL=http://localhost

我可以在 password_resets 表中看到令牌

我猜邮件中的令牌与密码重置表中存储的令牌不同,即哈希值。

我希望密码重置链接应该可以工作,并且我应该能够重置密码。

【问题讨论】:

  • 您是使用http://localhost 还是使用其他网址访问您的应用程序?
  • 嗯...localhost/laravel/public 是根...我也尝试将 APP_URL 作为localhost/laravel/public...电子邮件中的链接是localhost/password/reset/… 我确实尝试过剪切、更改和粘贴如下内容。 localhost/laravel/public/password/reset/… 我收到以下错误。路由 [password.update] 未定义。 (查看:C:\xampp\htdocs\laravel\resources\views\auth\passwords\reset.blade.php)
  • @YamenAshraf 你能检查一下吗..需要一些帮助...
  • 我认为这都是关于 APP_URL,Windows 上的开发也很痛苦,考虑 Homestead 并避免使用 Xampp mamp wamp 所有这些东西。
  • 请有其他建议..

标签: php laravel laravel-5.8 password-hash reset-password


【解决方案1】:
APP_URL=http://localhost

如果您在 APP_URL 的本地主机上,请添加端口

就我而言:

APP_URL=http://localhost:8000

【讨论】:

    【解决方案2】:

    进入你的项目文件夹,打开命令行,输入php artisan serve,然后输入APP_URL=http://127.0.0.1:8001

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-01-05
      • 2016-04-04
      • 2021-02-05
      • 2020-05-19
      • 1970-01-01
      • 1970-01-01
      • 2019-11-28
      • 1970-01-01
      相关资源
      最近更新 更多