Laravel 5.4 错误消息显示不适当的字段
Laravel 5.4 error messages displays inappropriate field
我正在使用 laravel 5.4 make:auth。在登录页面,我输入了一个有效的电子邮件地址,错误 password.The 错误消息显示 "These credentials do not match our records" 突出显示电子邮件地址字段而不是密码字段。
Login page with wrong password entered
在用户 table 中有条目。valid email in usertable
我知道,resources\lang\en\auth.php
'failed' => 'These credentials do not match our records.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
中显示的自定义错误消息
未对表格 login.blade.php 和 registercontroller.php
进行更改
为什么突出显示电子邮件地址框而不是密码框并在那里抛出错误。
此视图没有用于显示所有错误消息的一般区域,仅用于表单字段。控制器将此错误分配给 username
字段,以便它可以显示在页面上。它不知道凭据的哪一部分不正确,只是用户无法使用它们登录。
如果您阅读错误消息,它会显示 "These credentials do not match our records.",这是准确的。 email/password 组合不正确。这通常是可取的,因为您不想让可能成为黑客的人知道他们猜到了电子邮件地址。它显示在电子邮件字段中,因为页面没有一般错误。
我正在使用 laravel 5.4 make:auth。在登录页面,我输入了一个有效的电子邮件地址,错误 password.The 错误消息显示 "These credentials do not match our records" 突出显示电子邮件地址字段而不是密码字段。 Login page with wrong password entered
在用户 table 中有条目。valid email in usertable
我知道,resources\lang\en\auth.php
'failed' => 'These credentials do not match our records.',
'throttle' => 'Too many login attempts. Please try again in :seconds seconds.',
未对表格 login.blade.php 和 registercontroller.php
进行更改为什么突出显示电子邮件地址框而不是密码框并在那里抛出错误。
此视图没有用于显示所有错误消息的一般区域,仅用于表单字段。控制器将此错误分配给 username
字段,以便它可以显示在页面上。它不知道凭据的哪一部分不正确,只是用户无法使用它们登录。
如果您阅读错误消息,它会显示 "These credentials do not match our records.",这是准确的。 email/password 组合不正确。这通常是可取的,因为您不想让可能成为黑客的人知道他们猜到了电子邮件地址。它显示在电子邮件字段中,因为页面没有一般错误。