Это видео недоступно.
Сожалеем об этом.
Laravel Auth: Logout Other Devices after Login
HTML-код
- Опубликовано: 14 авг 2024
- Laravel 5.6 introduced a function Auth::logoutOtherDevices(), let's see it in action.
- - - - -
I'm available for freelance Laravel work, check out my Upwork profile: bit.ly/povilas-...
- - - - -
Our daily Laravel blog: laraveldaily.com
Our 50+ Laravel tips in a FREE e-book: bit.ly/laravel-...
Enroll in our online courses: bit.ly/laravel-...
Try our QuickAdminPanel code generator: bit.ly/quickadm...
Follow us on Twitter: bit.ly/twitter-...
Hi,
I tried this in Laravel 9 and it didn't work ... why ?
UPDATE:
it worked when I had to add the "AuthenticateSession" class to middleware group in kernel.php .. it was totally removed (not uncommented) , and I copied it from routemiddleware array from the same page ..
but a question arises, how to redirect the logged out devices to some route?
THANKS
Hello
Thank you for sharing !
I think it will be more interesting to integrate this functionality when changing the password:
Present the user with the possibility of invalidating the other sessions.
If we use the session table; there is the possibility to show the user the valid session (s).
by checking for example: close other sessions.
that said, thank you again for sharing !!!
thanks for your help..
thank you for sharing but if I want to do this with lumen how I can do?
thnks it worked, mention that to use Illuminate\Support\Facades\Auth; in controller
hello,
if there is a case like OTT platform where we need to allow login in only two device, so is there a way to logout form only one device with respect to last login activity timestamp on new login request from third device?
Thanks for the video, how to do it if I have Jetstream Fortify already installed?
It is possible only specific devices? except currently logged in?
Can you explain how laravel auto-logout is worked when an application is idle (inactive) for a certain time? where does Laravel manage the auto-logout code?
I have a problem with that, even not executing the method "logoutOtherDevices" sessions in other browsers are invalidated. I'm trying to give the option for my user to be able to mark a checkbox by requesting "logoutOtherDevices" when the user is changing their password.
Another problem is that the user who lost the session in the other browser is redirected to the route named "login". Where could I change which route it should go to if the session was invalidated by "logoutOtherDevices" ?
This is cool. Is there any way that you can get from the session that the user logged in in another browser so that the FF user knows why they've been logged out?
Good question, haven't researched that deep, at least haven't seen this functionality "on the surface".
Hello, teacher, I have a problem, I am making a system where they ask me to log in by connecting one device at a time. So I use a session_id attribute and save the session there, when I close the session I set the session_id to null. but I have a detail when the session expires, which is approximately 60 minutes, the session_id is no longer set, how can I solve that part. because if it is not set I cannot access another device or the same device. because it is not null session_id.
HELP!!!!
How to show flash / notif "you have been logout because...." when this feature work?
How to use the same concept in case of fortify . As in your fortify video you deleted all AUTH controllers while using laravel ui frontend .Can you please elaborate?
Nice. I didn't know about this feature. Thank you for sharing.
Is there a way to add flash message to logout users?
Thanks for sharing... Unfortunately this does not work with Jetstream and livewire... Can you do a tutorial for it?!? Regards
What If I don't want to logout from other devices and instead show a session that says "You can't log in from multiple devices. first logout from another device" ??
hola, me gustaria saber como puedo utilizar el metodo despues de loguear con id de usuario
How to do this with custom auth guard like admin?
hi, i got an issue in my projet is that i got automatically logs out users after submitting update form
Thank you for sharing !
how about api?
i need this function for my app but using api middleware not web.
How to this in laravel Breeze?
Very helpful.. Thanks
this tutorial is amazing
how to restrict to one device ?
please make this video when jetstream is already used, I searched a lot but there is no content,
and I'm stuck here, please help,
thank you for share this feature , i like it :D
Can I get a sample code, please?
Why I'm getting "Undefined variable: password"?
I didnt know you could do this
Awesome
THE BEST
Why has this post been removed from the laraveldaily.com website ?
It was never on laraveldaily.com website, it's just a RUclips video on this channel. I don't re-post them on the blog (but maybe I should?)
@@LaravelDaily I do get to see most of your recent videos as blog posts. By the way its helpful