In my sitecontroller I write like this
'access' => [ 'class' => AccessControl::className(), 'rules' => [ [ 'actions' => ['login', 'error'], 'allow' => true, ], [ 'actions' => ['logout', 'index' ,'call-back'], // add all actions to take guest to login page 'allow' => true, 'roles' => ['@'], ], ], ],
so If I go to index or call-back action,I'll redirected to login page. but I have to do it for all action to each controller. Could you tell me the best way to do it?