src/controllers/LoginController.php
private function sendArray($refresh, array $errors = [], $enterSecureToken = false, $message = null)
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        
        return [
            'refresh' => $refresh,
            'message' => $message,
            'errors' => $errors,
            'enterSecureToken' => $enterSecureToken,
            'time' => time(),
        ];
    }
private function sendArray($refresh, array $errors = [], $enterSecureToken = false, $message = null)
    {
        Yii::$app->response->format = Response::FORMAT_JSON;
        
        return [
            'refresh' => $refresh,
            'message' => $message,
            'errors' => $errors,
            'enterSecureToken' => $enterSecureToken,
            'time' => time(),
        ];
    }
private function sendArray ( $ refresh , array $ errors = [ ] , $ enterSecureToken = false , $ message = null ) { Yii :: $ app -> response -> format = Response :: FORMAT_JSON ; return [ 'refresh' => $ refresh , 'message' => $ message , 'errors' => $ errors , 'enterSecureToken' => $ enterSecureToken , 'time' => time ( ) , ] ; }
Change the response format to json and return the array.

@param boolean $refresh
@param array $errors
@param boolean $enterSecureToken
@param string $message
@return array
Change the response format to json and return the array .