Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behaviors doesn't seem to work #27

Open
sagittaracc opened this issue Feb 16, 2021 · 2 comments
Open

Behaviors doesn't seem to work #27

sagittaracc opened this issue Feb 16, 2021 · 2 comments

Comments

@sagittaracc
Copy link

namespace app\controllers;

use yii\filters\AccessControl;

class ApiController extends \JsonRpc2\Controller
{
	use \JsonRpc2\extensions\AuthTrait;

	public function behaviors()
	{
		return [
			'access' => [
				'class' => AccessControl::className(),
				'except' => ['login'],
				'rules' => [
					[
						'allow' => true,
						'roles' => ['@'],
					],
				],
			],
		];
	}

	public function actionUpdate() {
		return 'update';
	}

	public function actionLogin() {
		return 'login';
	}
}

The login action cannot be reached after that :(

@sagittaracc
Copy link
Author

more specifically it seems like 'except' doesn't work but 'only' does

@sagittaracc
Copy link
Author

I figured it out
#28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant