diff --git a/app/Http/Controllers/Dashboard/DashboardController.php b/app/Http/Controllers/Dashboard/DashboardController.php new file mode 100644 index 0000000..5ff2766 --- /dev/null +++ b/app/Http/Controllers/Dashboard/DashboardController.php @@ -0,0 +1,20 @@ +middleware('role:Uesr'); + } + + public function index() { + return redirect('/'); + } + + public function profile() { + return redirect('/'); + } +} diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index fa349a1..89cb8ca 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -4,9 +4,18 @@ namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; +use Socialite; +use DB; + +use App\Models\User\User; +use Seat\Eseye\Cache\NullCache; +use Seat\Eseye\Configuration; +use Seat\Eseye\Containers\EsiAuthentication; +use Seat\Eseye\Eseye; class RedirectIfAuthenticated { + /** * Handle an incoming request. * @@ -17,10 +26,9 @@ class RedirectIfAuthenticated */ public function handle($request, Closure $next, $guard = null) { - //if (Auth::guard($guard)->check()) { - // return redirect('/home'); - //} - + if (Auth::guard($guard)->check()) { + return redirect()->to('/dashboard'); + } return $next($request); } -} +} \ No newline at end of file diff --git a/routes/web.php b/routes/web.php index 0c8de69..86eb32d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -22,8 +22,8 @@ Route::group(['middleware' => ['auth']], function(){ /** * Dashboard Controller Display pages */ - Route::get('/dashboard', 'Dashboard\DashboardController@index'); - Route::get('/profile', 'Dashboard\DashboardController@profile'); + //Route::get('/dashboard', 'Dashboard\DashboardController@index'); + //Route::get('/profile', 'Dashboard\DashboardController@profile'); });