golem / auth-storage-symfony
Symfony Session storage adapter for Golem Auth
Installs: 83
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/golem/auth-storage-symfony
Requires
- php: 7.4.*|8.*
- golem/auth: ^3.0
- symfony/http-foundation: ^5.4|^6.2
Requires (Dev)
- phpunit/phpunit: ^9.6
- squizlabs/php_codesniffer: ^3.7
README
Symfony Session storage adapter for Golem Auth
Install
Via Composer
$ composer require golem/auth-storage-symfony
Usage
Follow the documentation on Golem Auth to create a user model and a user repository class.
use ; use Symfony\Component\HttpFoundation\Session\Session; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; // configure the symfony session as usual $session_storage = new NativeSessionStorage(array(), new NativeFileSessionHandler()); $session = new Session($session_storage); $storage = new \Golem\Auth\Storage\SymfonySessionStorage($session); // get an instance of your user repository however you need to $userRepository = new UserRepository($database_connection); $auth = new \Golem\Auth($storage, $userRepository);
Testing
$ composer test
License
The MIT License (MIT). Please see License File for more information.