SleepingOwlAdmin / demo

This is demo application for SleepingOwl Admin.
http://demo.sleepingowladmin.ru
93 stars 55 forks source link

I can access admin dashboard directly without login. #14

Closed waqasmehmud closed 7 years ago

waqasmehmud commented 8 years ago

I need to restrict admin area by login.

butschster commented 8 years ago

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

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

waqasmehmud commented 8 years ago

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

waqasmehmud commented 8 years ago

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

butschster commented 8 years ago

php artisan sleepingowl:install https://github.com/LaravelRUS/SleepingOwlAdmin#authentication

waqasmehmud commented 8 years ago

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

butschster commented 8 years ago

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'],
waqasmehmud commented 8 years ago

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 8 years ago

@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.