此密码重置令牌无效-使用laravel
我在重置密码时遇到问题我正在使用laravel的auth routes和view,我已经运行了php artisan make:auth及其生成的内置路由和视图,但我不知道问题出在哪里:此密码重置令牌无效-使用laravel,laravel,passwords,token,change-password,Laravel,Passwords,Token,Change Password,我在重置密码时遇到问题我正在使用laravel的auth routes和view,我已经运行了php artisan make:auth及其生成的内置路由和视图,但我不知道问题出在哪里: public function showResetForm(Request $request, $token = null) { return view('auth.passwords.reset')->with( ['token' => $token,
public function showResetForm(Request $request, $token = null)
{
return view('auth.passwords.reset')->with(
['token' => $token, 'email' => $request->email]
);
}
public function reset(Request $request)
{
$this->validate($request, $this->rules(), $this->validationErrorMessages());
// Here we will attempt to reset the user's password. If it is successful we
// will update the password on an actual user model and persist it to the
// database. Otherwise we will parse the error and return the response.
$response = $this->broker()->reset(
$this->credentials($request), function ($user, $password) {
$this->resetPassword($user, $password);
}
);
// If the password was successfully reset, we will redirect the user back to
// the application's home authenticated view. If there is an error we can
// redirect them back to where they came from with their error message.
return $response == Password::PASSWORD_RESET
? $this->sendResetResponse($response)
: $this->sendResetFailedResponse($request, $response);
}
我不知道问题出在哪里?
非常感谢你的帮助
我还附上了屏幕截图,这是laravel提供的内置cold,我没有编写任何代码。将此标签添加到头部
<meta name="csrf-token" content="{{ csrf_token() }}">
我仍然不明白为什么会出现此错误,请您进一步指导我好吗问题是,因为表密码重置中的令牌已经过期(过期可以在/config/auth.php
中设置)。这与@Shokry Mohamed提到的表单令牌(\u令牌
)无关