drago-ex/project-user

There is no license information available for the latest version (v1.0.3) of this package.

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:drago-project-resource

pkg:composer/drago-ex/project-user

v1.0.3 2025-12-27 19:50 UTC

This package is auto-updated.

Last update: 2025-12-27 21:17:04 UTC


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.

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