So I have seen post on how to set the default route in Yii 1 whereby the initial page is the login page, but no posts on how to do this in Yii 2.
What I need is for all users to first login and to then be able to use CRUD functions, with some users able to do more than others.
For your information, I am using the basic template.
try in basic\config\web.php
add
'loginUrl' => ['user/login'],
to user in components]