codekandis/tiphy-authentication-integration

This library is an integration of `codekandis/authentication` into `codekandis/tiphy`.

0.11.1 2022-08-10 22:49 UTC

This package is auto-updated.

Last update: 2024-05-11 02:43:30 UTC


README

Version License Minimum PHP Version Code Coverage

This library is an integration of codekandis/authentication into codekandis/tiphy.

Index

Installation

Install the latest version with

$ composer require codekandis/tiphy-authentication-integration

How to use

Just inject the AuthorizationHeaderKeyAuthenticationPreDispatcher into the ActionDispatcher.

<?php declare( strict_types = 1 );
namespace Vendor\Project;

use CodeKandis\Tiphy\Actions\ActionDispatcher;
use CodeKandis\TiphyAuthenticationIntegration\Actions\PreDispatchment\Api\AuthorizationHeaderKeyAuthenticationPreDispatcher;

$routesConfiguration = /** ... */;
$throwableHandler    = /** ... */;
$usersRepository     = /** ... */;
$preDispatcher       = new AuthorizationHeaderKeyAuthenticationPreDispatcher( $usersRepository );

$actionDispatcher = new ActionDispatcher( $routesConfiguration, $preDispatcher, $throwableHandler );
$actionDispatcher->dispatch();