mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
Log user out of other devices when they change their password
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c9ef49ec65
commit
6fde72a693
|
@ -4,7 +4,7 @@ namespace App\Http\Controllers;
|
|||
|
||||
use App\Http\Requests\ImageUploadRequest;
|
||||
use App\Models\Setting;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Gate;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
@ -186,6 +186,9 @@ class ProfileController extends Controller
|
|||
if (! $validator->fails()) {
|
||||
$user->password = Hash::make($request->input('password'));
|
||||
$user->save();
|
||||
|
||||
// Log the user out of other devices
|
||||
Auth::logoutOtherDevices($request->input('password'));
|
||||
return redirect()->route('account.password.index')->with('success', 'Password updated!');
|
||||
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ class Kernel extends HttpKernel
|
|||
\App\Http\Middleware\CheckForTwoFactor::class,
|
||||
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
|
||||
\App\Http\Middleware\AssetCountForSidebar::class,
|
||||
\Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
|
|
Loading…
Reference in a new issue