且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Laravel和Passport在身份验证失败时响应状态码401?

更新时间:2023-12-03 10:12:46

您可以通过发送带有请求的标头来解决它.

You can solve it by sending this header with your request.

Accept : application/json

这将使用状态代码401发送此消息.

This will send this message with 401 status code.

{
    "message": "Unauthenticated."
}