[ 'class' => AccessControl::class, 'rules' => [ [ 'actions' => ['current'], 'allow' => true, 'roles' => ['@'], ], ], ], ]); } public function verbs() { return [ 'current' => ['GET'], ]; } public function actionCurrent() { /** @var Account $account */ $account = Yii::$app->user->identity; return [ 'id' => $account->id, 'username' => $account->username, 'email' => $account->email, 'shouldChangePassword' => $account->password_hash_strategy === Account::PASS_HASH_STRATEGY_OLD_ELY, ]; } }