mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-11 09:40:43 +01:00
26 lines
468 B
PHP
26 lines
468 B
PHP
<?php
|
|
|
|
namespace App\Http\Middleware;
|
|
|
|
use Closure;
|
|
use Illuminate\Support\Facades\Auth;
|
|
|
|
class ForceLogout
|
|
{
|
|
/**
|
|
* Handle an incoming request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @param string $guards
|
|
* @return mixed
|
|
*/
|
|
public function handle($request, Closure $next, ...$guards)
|
|
{
|
|
if (Auth::user() != null) {
|
|
Auth::logoutCurrentDevice();
|
|
}
|
|
|
|
return $next($request);
|
|
}
|
|
}
|