Download the PHP package juliomotol/laravel-auth-timeout without Composer
On this page you can find all versions of the php package juliomotol/laravel-auth-timeout. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download juliomotol/laravel-auth-timeout
More information about juliomotol/laravel-auth-timeout
Files in juliomotol/laravel-auth-timeout
Package laravel-auth-timeout
Short Description Authentication Timeout for Laravel
License MIT
Homepage https://github.com/juliomotol/larave-auth-timeout
Informations about the package laravel-auth-timeout
Laravel Auth Timeout
Handle Authentication timeouts in Laravel.
When upgrading to v4, please see the CHANGELOG.md.
For Laravel 8+ support, see v3.
For Laravel 6+ support, see v2.
Why Laravel Auth Timeout?
There are times where we want to log out a user when they haven't done any request within a set time. There is a workaround (below):
But this affects the entirety of the session. But it doesnt have to be and that is where Laravel Auth Timeout comes in.
Laravel Auth Timeout is a small middleware package that checks if the user had made any request in a set of time. If they have reached the idle time limit, they are then logged out on their next request. Thanks to Brian Matovu's article.
Installation
You can install the package via composer:
You can publish the config file with:
This is the contents of the published config file:
Usage
Quick Start
For a simple usage, register the CheckAuthTimeout
in your Kernel.php
.
Then use that middleware on a route.
Using Different Guards
You might have multiple guards and only want to apply CheckAuthTimeout
to certain ones. We got you covered, CheckAuthTimeout
accepts a $guard
parameter.
NOTE: This package only works with guards that uses a
session
driver.
AuthTimedOut
An AuthTimedOut
will be dispatch every time a user has timed out. You can assign a listener for this event in your EventServiceProvider
.
AuthTimedOut
has two properties that you can access in your EventListener
.
Redirection
To modify the redirection when a user has timed out, you can use CheckAuthTimeout::setRedirectTo()
within your AppServiceProvider
to set a redirection callback.
AuthTimeout Facade
This package also provides a facade with the following methods:
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Julio Motol
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-auth-timeout with dependencies
spatie/laravel-package-tools Version ^1.13.0
illuminate/auth Version ^9.0|^10.0|^11.0
illuminate/events Version ^9.0|^10.0|^11.0
illuminate/session Version ^9.0|^10.0|^11.0
illuminate/support Version ^9.0|^10.0|^11.0