netpromotion/data-signer

Data Signer for PHP

v1.2.1 2019-08-08 05:57 UTC

This package is auto-updated.

Last update: 2024-10-29 05:10:46 UTC


README

Examples

Password reset

/** @var int $userId */
/** @var Netpromotion\DataSigner\DataSignerInterface $signer */
$token = (string) $signer->withDomain('user.reset_password')->signData($userId, 12 * 3600);
send_reset_password_email($userId, $token);
/** @var Netpromotion\DataSigner\DataSignerInterface $signer */
$userId = $signer->withDomain('user.reset_password')->getData($_GET['token']);
set_password($userId, $_POST['new_password']);