andollini89/authenticator

login plugin

Installs: 4

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:composer-plugin

dev-main 2023-01-31 20:52 UTC

This package is auto-updated.

Last update: 2025-06-29 02:17:00 UTC


README

Installation

composer require andollini89/authenticator:dev-main --no-plugins
composer install

Details

The package contains:

  • Authenticate Class which provide the login function and the isLogged function.
  • UserProvider which implements UserProviderInterface and provide the getUser function to search for user in source/database.

Usage exemple

<?php

use Authenticator/UserProvider;
use Authenticator/Authenticate;

$pdo = new \PDO('sqlite:test.db'); // or any other source

$userProvider = new UserProvider($pdo);
$auth = new Authenticate($userProvider, 'path/to/login')

if ($authenticated = $auth->isLogged() === false) {
    $authenticated = $auth->login('username', 'password', true)
} else {
   // more code here
}