From faed561f9cf0aabc5df163bf9506d7efc59cb3f7 Mon Sep 17 00:00:00 2001 From: iIronside Date: Fri, 7 Jan 2022 15:14:46 +0300 Subject: [PATCH] api added id in response to login --- frontend/modules/api/controllers/UserController.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/modules/api/controllers/UserController.php b/frontend/modules/api/controllers/UserController.php index d725bbb..84978af 100755 --- a/frontend/modules/api/controllers/UserController.php +++ b/frontend/modules/api/controllers/UserController.php @@ -67,7 +67,9 @@ class UserController extends ActiveController $model = new LoginForm(); if ($model->load(Yii::$app->getRequest()->getBodyParams(), '') && $model->login()) { return [ - 'access_token' => $model->login(), 'access_token_expired_at' => $model->getUser()->getTokenExpiredAt() + 'access_token' => $model->login(), + 'access_token_expired_at' => $model->getUser()->getTokenExpiredAt(), + 'id' => $model->getUser()->id, ]; } else { throw new BadRequestHttpException(json_encode($model->errors));