drago-ex / project-auth
Authentication and user access package for the Drago project.
Package info
github.com/drago-ex/project-auth
Type:drago-project-resource
pkg:composer/drago-ex/project-auth
Requires
- php: >=8.3 <9
- drago-ex/application: ^2.0
- drago-ex/database: ^3.0
- drago-ex/form: ^2.0
- drago-ex/project-backend: ^2.0
- drago-ex/project-front: ^2.0
- drago-ex/translator: ^3.0
- drago-ex/utils: ^2.0
- nette/mail: ^4.0
Requires (Dev)
- drago-ex/project-tools: @dev
- phpstan/phpstan-nette: ^2.0
README
Authentication and user access package for the Drago project. This package provides a complete authentication layer including user login, registration, password recovery and access control. It is designed as a modular extension for projects built on top of the Drago ecosystem and Nette framework.
Requirements
- PHP >= 8.3
- Nette Framework
- Composer
- Bootstrap
- Naja
- Node.js
- Drago Project core packages
Installation
composer require drago-ex/project-auth
Project files
File copying is handled automatically by drago-ex/project-tools,
which must be installed in your project. Without it, copy the files manually according to the copy section
in this package's composer.json. To skip this package, set "skip": true under
extra.drago-project.packages.<package-name> in your root composer.json.
Features
- User authentication (sign in / sign out)
- User registration (sign up)
- Password recovery and reset
- User identity handling
- Integration with Nette Security and DI
- Ready-to-use backend UI components
Adds a new user to the database
Hashes the password, generates a token, and ensures the email is unique.
php vendor/bin/create-user <username> <email> <password>
Secure access to the section
final class SecurePresenter extends Presenter { use App\UI\Backend\Sign\UserRequireLogged; }
Generate permission provider
If you use project ACL (drago-ex/permission), you can generate a module permission class:
php vendor/bin/create-auth-permission
Database migration
php vendor/bin/migration db:migrate vendor/drago-ex/project-auth/migrations
Automated setup
This package exposes setup commands in composer.json under extra.drago-project.commands.
If drago-ex/project-tools is installed, you can run them from the project root:
php vendor/bin/drago-setup