SleepingOwlAdmin/demo

I can access admin dashboard directly without login.

waqasmehmud opened this issue · 8 comments

I need to restrict admin area by login.

You can change default guard to admin or change middleware in config/sleeping_owl.php to

'middleware' => ['web', 'auth:admin'],

sleeping_owl.php this file does not exists here https://github.com/SleepingOwlAdmin/demo/tree/master/config

even on demo link i can access admin area without login http://demo.sleepingowladmin.ru/admin

I followed all the steps, admin link now redirects to frontend login and after login it redirects to frontend home page not admin dashboard

You should run artisan command php artisan sleepingowl:install
And then you should open config/sleeping_owl.php and append middleware auth:admin

// before
'middleware' => ['web'],

// after
'middleware' => ['web', 'auth:admin'],

yes, did exactly same as you said. tried with new installation as well. but results still same. it redirects to default laravel auth login and after login to home page. i can't access dashboard.

SCIF commented

@butschster , @waqasmehmud not auth:admin — just auth for default installation of demo app. I.e., slepping_owl.php

    'middleware' => ['web', 'auth'],

@butschster , what do you think to add it as default to demo application? It seems expectable if you install demo app.