Laravel OAuth在laravel.log中登录失败

时间:2018-08-06 11:30:08

标签: php laravel

当我的网站登录失败时,在laravel.log文件中记录了错误。我使用laravel护照进行api身份验证。

错误:

[2018-08-06 13:27:35] local.ERROR: League\OAuth2\Server\Exception\OAuthServerException: The user credentials were incorrect. in /home/roberto/new_site/vendor/league/oauth2-server/src/Exception/OAuthServerException.php:128

如何禁用oauth日志?

1 个答案:

答案 0 :(得分:2)

您可以将该异常添加到$dontReport中的app\Exceptions\Handler.php数组中。

protected $dontReport = [
    \Illuminate\Validation\ValidationException::class,
    // ....
    \League\OAuth2\Server\Exception\OAuthServerException::class,
];

这应禁用该异常的报告(记录)。有关更多信息,请参见https://laravel.com/docs/5.6/errors#the-exception-handler