Skip to content
This repository has been archived by the owner on Feb 8, 2022. It is now read-only.

Commit

Permalink
Protecting routes issue fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhqc committed Aug 5, 2019
1 parent aad375f commit 67a6a1a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
6 changes: 1 addition & 5 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ class LoginController extends Controller
*/
protected $redirectTo = '/home';

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct() {
$this->middleware('guest')->except('logout');
}
Expand Down Expand Up @@ -66,6 +61,7 @@ public function logout(Request $request)
Auth::guard()->logout();

$request->session()->invalidate();
$request->session()->flush();

return redirect('/');
}
Expand Down
12 changes: 3 additions & 9 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,9 @@

class HomeController extends Controller
{
/**
* Crea una instancia del controlador.
*
* @return void
*/
// public function __construct()
// {
// $this->middleware('guest');
// }
public function __construct() {
$this->middleware('auth');
}

public function showHome() {
return view('home');
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
Expand Down

0 comments on commit 67a6a1a

Please sign in to comment.