Search by

marko / authentication-database

markshust

Database-backed password reset token storage for Marko Framework

Package info

github.com/marko-php/marko-authentication-database

Type:marko-module

pkg:composer/marko/authentication-database

Statistics

Installs: 2

Dependents: 0

Suggesters: 0

Stars: 0

0.13.0 2026-11-03 18:23 UTC

This package is auto-updated.

Last update: 2026-11-03 19:13:56 UTC


README

Database-backed password reset token storage --- reset tokens survive cache flushes and auth:clear-reset-tokens deletes expired rows.

Installation

composer require marko/authentication-database

Requires marko/database and one of its drivers. Then run marko db:migrate to create the password_reset_tokens table from the entity the package ships.

Quick Example

use Marko\Authentication\Contracts\PasswordResetBrokerInterface;

public function __construct(
    private readonly PasswordResetBrokerInterface $passwordResetBroker,
) {}

public function forgotPassword(string $email): void
{
    $this->passwordResetBroker->sendResetLink(['email' => $email]);
}

Installing this package replaces the cache-backed PasswordResetTokenRepositoryInterface default of marko/authentication, so the broker stores tokens in the table. Schedule marko auth:clear-reset-tokens to delete expired ones.

Documentation

Full usage, API reference, and examples: marko/authentication-database