Skip to content

Commit

Permalink
fix logout() when using AuthenticateSession middleware (#826)
Browse files Browse the repository at this point in the history
  • Loading branch information
EmanueleCoppola authored Oct 5, 2020
1 parent 02379dd commit 613778f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Laravel\Dusk\Http\Controllers;

use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Str;

class UserController
Expand Down Expand Up @@ -56,6 +57,8 @@ public function login($userId, $guard = null)
public function logout($guard = null)
{
Auth::guard($guard ?: config('auth.defaults.guard'))->logout();

Session::forget('password_hash_'.$guard ?: config('auth.defaults.guard'));
}

/**
Expand Down

0 comments on commit 613778f

Please sign in to comment.