Search by

marko / authentication

markshust

Authentication and authorization for Marko Framework

Package info

github.com/marko-php/marko-authentication

Type:marko-module

pkg:composer/marko/authentication

Statistics

Installs: 647

Dependents: 11

Suggesters: 2

Stars: 0

0.11.0 2026-10-06 15:20 UTC

README

Session and token-based authentication---guards protect routes, remember-me keeps users signed in, events track activity, middleware controls access.

Installation

composer require marko/authentication

Quick Example

use Marko\Authentication\AuthManager;
use Marko\Routing\Http\Response;

class LoginController
{
    public function __construct(
        private AuthManager $authManager,
    ) {}

    public function login(array $credentials): Response
    {
        if ($this->authManager->attempt($credentials)) {
            return Response::redirect('/dashboard');
        }

        return new Response('Invalid credentials', 401);
    }
}

Documentation

Full usage, configuration, remember-me setup, events, and API reference: marko/authentication