You can modify answer API framework Yii2?

Hello!
when the user is not authorized, then API will return such answer
{
 "name": "Unauthorized",
 "message": "Your request was made with invalid credentials.",
 "code": 0,
 "status": 401,
 "type": "yii\\web\\UnauthorizedHttpException"
}

is it possible to edit this answer and make your own response? and how is it?
June 8th 19 at 16:44
1 answer
June 8th 19 at 16:46
to cover the class authorization who are using and in this method you rewrite it
in Yii2 ActiveController used for rest API
but it can not seem to find where it checks authorization..... - Jessica.Schmele commented on June 8th 19 at 16:49
https://github.com/yiisoft/yii2/blob/master/docs/g... - Mitchell_Zemlak16 commented on June 8th 19 at 16:52
not clear? ) - Mitchell_Zemlak16 commented on June 8th 19 at 16:55
I have exactly the same structure....
but when findIdentityByAccessToken method returns falls then returns the answer Unauthorized....but where this happen I can't find.... - Jessica.Schmele commented on June 8th 19 at 16:58
, www.yiiframework.com/doc-2.0/yii-rest-activecontro... - Henderson_Beat commented on June 8th 19 at 17:01
in detail it is possible? have looked but not found the answer... - Jessica.Schmele commented on June 8th 19 at 17:04

Find more questions by tags YiiAPI