Start Coding with Codelab | Jaeves AI

Laravel logout from all devices – Jaeves Codelab

Written by Admin | Oct 2, 2023 9:03:42 PM

Laravel logout from all devices

Close the authenticated routes in AuthenticateSession middleware using auth.session key.

Route::middleware(['auth', 'auth.session'])->group(function () {
    //routes 
});
public function logoutAllDevices(Request $request){
     $currentPassword = $request->input('currentpassword');
     Auth::logoutOtherDevices($currentPassword);
}

click for more Laravel codes read about laravel authentication