Skip to content

drago-ex/project-user

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drago Project user

A user management and authentication package for the Drago Project. Provides secure and type-consistent access to user data, authentication, tokens, and access protection.

License: MIT PHP version Coding Style

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 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;
}

About

💡 Type-safe user and authentication support for Drago Project.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages