2016-12-14 70 views
4

當我使用laravel5.3的護照Password Grant Tokens如何自定義laravel護照錯誤信息?

this.$http.post('/oauth/token', this.form) 
    .then(response => { 
     console.log(response) 
    }) 

我得到這個消息

{"error":"invalid_credentials","message":"The user credentials were incorrect."} 

我想知道如何自定義此錯誤消息。

+0

這是由'vendor \ league \ oauth2-server \ src \ Exception \ OAuthServerException.php'發送的信息:120行 – TonyCat

回答

0

你可以在laravel/passport github的問題找到答案。所需要的是用不同的實現替換Laravel \ Passport \ Http \ Controllers \ AccessTokenController。