Open rohini-knowlens opened 3 years ago
@rohini-knowlens Hi, which version of Yii and the package?
Yii version => 2.0.40 and filsh/yii2-oauth2-server => 2.1.0
Hi,
I think this comment in the \yii\base\Module
class should be relevant for this issue :
* Since version 2.0.13, if a component isn't defined in the module, it will be looked up in the parent module.
* The parent module may be the application.
public function has($id, $checkInstance = false)
{
return parent::has($id, $checkInstance) || (isset($this->module) && $this->module->has($id, $checkInstance));
}
So the response is retrieved from the parent module \Yii\app ...
What do you think about resetting the response to the correct type in the filsh\yii2\oauth2server\Module
if the type is \yii\web\Response
?
@rohini-knowlens , Have you solved this problem? I have same problem in :
Hi, I am trying to implement oauth2 for my rest API but getting this error in authorize action. Can anyone please help me on this.
Argument 2 passed to OAuth2\Server::handleAuthorizeRequest() must be an instance of OAuth2\ResponseInterface, instance of yii\web\Response given, called in vendor\filsh\yii2-oauth2-server\src\Server.php on line 59
Sample code public function actionAuthorize() {