netpromotion / data-signer
Data Signer for PHP
v1.2.1
2019-08-08 05:57 UTC
Requires
- php: >=5.6
- nunzion/php-expect: ^1.1
- petrknap/php-enum: ^2.1
Requires (Dev)
- phpunit/phpunit: ^5.7
This package is auto-updated.
Last update: 2024-11-29 05:26:52 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']);