1

An Error occurred while handling another error:

exception 'yii\web\ForbiddenHttpException' with message 'Login Required' in C:\wamp\www\k\kometonline\vendor\yiisoft\yii2\web\User.php:431

Am getting this error after installing RBAC in backend admin login page (site.com/backend/web/site/login). Whats the main cause of this problem. I don't know what code to post. Please comment below If you need any code. Thanks in advance.

Insane Skull
  • 8,810
  • 9
  • 38
  • 59
Kartz
  • 503
  • 3
  • 8
  • 20

1 Answers1

1

I encountered the same error while installing RBAC in backend admin login page while following this tutorial: RBAC Super Simple with Admin and User

You may try doing the changes you made at the frontend login SiteController and see if works. The difference between these two SiteControllers is that the frontend already uses access rules in its behavior method.

From there you can compare the SiteControllers at backend and frontend and see what makes it work. In my case I simply added one line

'only' => ['logout'],

just below

'class' => AccessControl::className(),

and it worked!

rob006
  • 18,710
  • 5
  • 41
  • 58