Skip to content

Latest commit

 

History

241 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drago Project Auth

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.

License: MIT PHP version Coding Style

Requirements

  • PHP >= 8.3
  • Nette Framework
  • Composer
  • Bootstrap
  • Naja
  • Node.js
  • Drago Project core packages

Installation

composer require drago-ex/project-auth

npm Installation

The authentication UI requires the theme switcher and Font Awesome icons:

npm install theme-switcher-compostrap @fortawesome/fontawesome-free

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-tools.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 authentication 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

use App\Presentation\Accessory\RequireLogged;
use Nette\Application\UI\Presenter;

final class SecurePresenter extends Presenter
{
	use RequireLogged;
}

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-tools.commands. If drago-ex/project-tools is installed, you can run them from the project root:

php vendor/bin/drago-setup

About

💡 Authentication and user access package for the Drago project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages