| @@ -96,8 +96,12 @@ | ||
| 96 | 96 | return 0; |
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | + public static function consume( string $token, string $client_id ): bool { | |
| 101 | + return (bool) static::delete( $token, $client_id ); | |
| 102 | + } | |
| 103 | + | |
| 100 | 104 | public static function generate( int $bytes = 16 ): string { |
| 101 | 105 | try { |
| 102 | 106 | return \bin2hex( \random_bytes( $bytes ) ); |
| 103 | 107 | } catch ( \Exception $e ) { |