drago-ex / project-user
Type-safe user and authentication support for Drago Project.
Installs: 23
Dependents: 1
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:composer-plugin
pkg:composer/drago-ex/project-user
Requires
- php: >=8.3 <9
- composer-plugin-api: ^2.3
- drago-ex/database: ^2.0
- nette/application: ^3.2
- nette/di: ^3.2
- nette/security: ^3.2
Requires (Dev)
- composer/composer: ^2.9
- phpstan/phpstan-nette: ^1.2.9
README
A user management and authentication package for the Drago Project. Provides secure and type-consistent access to user data, authentication, tokens, and access protection.
Requirements
- PHP >= 8.3
- Nette Framework
- Drago Project core packages
Main features
- User identity management via User and UserIdentity
- Authentication and token management via UserRepository
- Centralized access protection via the UserRequireLogged trait
- Type-safe exceptions and interfaces (UserIdentityException, UserToken)
- UsersEntity data entity for working with users in the database
- Easy integration with Nette DI
Install
composer config --no-plugins allow-plugins.drago-ex/project-user true
composer require drago-ex/project-user
How to use
#[Inject] public App\Core\User\UserAccess $userAccess;
In the template
protected function beforeRender(): void { parent::beforeRender(); $this->template->userAccess = $this->userAccess; }
Access to identity data
{varType App\Core\User\UserAccess $userAccess} {block content} <p>{$userAccess->getUserIdentity()->username}</p> {/block}
Secure access to the section
final class SecurePresenter extends Presenter { use App\Core\User\UserRequireLogged; }