I have created a new folder in yii2 at same level with backend and frontend to handle rest api calls. This folder contains a module for apis. It has a models with a User.php model. Am not using the one in common folder as this model is special to this module. Inside it, I have a method called
public function getAuthKey() {
return $this->auth_key;
}
. So when I to try to call this method in my user controller as
Yii::$app->user->identity->getAuthKey()
, it returns null. I don’t know why I think it might be trying to get the one from user class in common folder and not from the one in the module. Please help.