| 1 |
<?php |
| 2 |
|
| 3 |
namespace Yoast\WP\SEO\AI_Authorization\Application; |
| 4 |
|
| 5 |
use Yoast\WP\SEO\AI_Authorization\Domain\Code_Verifier; |
| 6 |
|
| 7 |
/** |
| 8 |
* Interface Code_Verifier_Handler_Interface |
| 9 |
* |
| 10 |
* This interface defines the methods for handling code verifier. |
| 11 |
*/ |
| 12 |
interface Code_Verifier_Handler_Interface { |
| 13 |
|
| 14 |
/** |
| 15 |
* Generate a code verifier for a user. |
| 16 |
* |
| 17 |
* @param string $user_email The user email. |
| 18 |
* |
| 19 |
* @return Code_Verifier The generated code verifier. |
| 20 |
*/ |
| 21 |
public function generate( string $user_email ): Code_Verifier; |
| 22 |
|
| 23 |
/** |
| 24 |
* Validate the code verifier for a user. |
| 25 |
* |
| 26 |
* @param int $user_id The user ID. |
| 27 |
* |
| 28 |
* @return string The code verifier. |
| 29 |
* |
| 30 |
* @throws RuntimeException If the code verifier is expired or invalid. |
| 31 |
*/ |
| 32 |
public function validate( int $user_id ): string; |
| 33 |
} |
| 34 |
|