zalkarz / cookie-based-auth
Cookie-based authentication middleware for Laravel.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Language:Blade
Requires
- php: ^7.3 || ^8.0
- illuminate/support: ^8 || ^9 || ^10
Requires (Dev)
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2024-05-16 05:38:42 UTC
README
Cookie-based authentication is a Laravel middleware that provides cookie-based authentication functionality. It allows you to secure your application from any access.
Installation
You can install this package via Composer. Simply run the following command:
composer require zalkarz/cookie-based-auth
Usage
To use the Cookie-based authentication middleware, follow these steps:
- Add the middleware to your route or route group in your Laravel application.
- Configure the required environment variables for authentication credentials.
- Customize the authentication logic if needed.
Here's an example of how to add the middleware to a route group:
protected $middlewareGroups = [ 'web' => [ ... \Zalkarz\CookieBasedAuth\Http\Middleware\CookieBasedAuth::class ], ];
Configuration
Make sure to set these environment variables in your .env file or your server configuration. For example:
COOKIE_BASED_AUTH_USERNAME=johndoe COOKIE_BASED_AUTH_PASSWORD=mypassword
Contributing
Contributions are welcome! If you find any issues or want to add new features, please submit a pull request.
License
This package is open-source software licensed under the MIT license.