mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 01:06:46 +00:00
You can logout other sessions.
This commit is contained in:
@@ -86,6 +86,38 @@ class ProfileController extends Controller
|
||||
$this->middleware(IsDemoUser::class)->except(['index']);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function logoutOtherSessions()
|
||||
{
|
||||
//
|
||||
return view('profile.logout-other-sessions');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Request $request
|
||||
*
|
||||
* @return \Illuminate\Contracts\Foundation\Application|RedirectResponse|Redirector
|
||||
*/
|
||||
public function postLogoutOtherSessions(Request $request)
|
||||
{
|
||||
$creds = [
|
||||
'email' => auth()->user()->email,
|
||||
'password' => $request->get('password'),
|
||||
];
|
||||
if (Auth::once($creds)) {
|
||||
Auth::logoutOtherDevices($request->get('password'));
|
||||
session()->flash('info', (string) trans('firefly.other_sessions_logged_out'));
|
||||
|
||||
return redirect(route('profile.index'));
|
||||
}
|
||||
session()->flash('error', (string) trans('auth.failed'));
|
||||
|
||||
return redirect(route('profile.index'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Change your email address.
|
||||
*
|
||||
|
Reference in New Issue
Block a user