'Logging out a user after successful change of email from emailed link

I have a laravel 9 application and i am using the provided authentication that ships with laravel. However when i send a user a link like

http://127.0.0.1:8000/password/reset/320dd955509c9a236f122a700eec80f0daf18ebdef27770f3d2641ea55d74359?email=admin%40example.com

i would like to logout the user and redirect the user to the login page. How can i logout the user?



Solution 1:[1]

I hope this will help you

use Illuminate\Support\Facades\Auth;

.....

Auth::logout();

return redirect()->route('login);

or

return redirect()->route('somewhere);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Abdul Haseeb Khan