Yii2 overiding user/login for backend

1.4k views Asked by At

I am using yii2-user module on top of the standard Yii2 advanced demo.

Yii2-user provides it's own login function at /user/security/login and linking directly to that works perfectly.

However the advanced demo overides that and directs the call to /user/login probably using the internal routes but I cant track down where that is happening.

I need to tell my Yii2 site not to chip in its own login ( which I have deleted ) and to retain the route to /user/security/login.

config file is directing user to the dektrium yii2-user module and it all seems to be working, it's just the default action into the backend page that reroutes to user/login when a visitor is a guest instead of a registered admin.

2

There are 2 answers

3
soju On

Backend has its own configuration, you should simply modify user component loginUrl in backend/config/main.php .

0
Sooraj ER On

Inside your backend config.php add one more component

    'user' => [
        'loginUrl' => ['user/security/login'],
    ],

It helps me out in frontend