Skip to content

Commit

Permalink
Merge pull request #105 from PhpGt/htmldocumentprotector-return-token
Browse files Browse the repository at this point in the history
Return token once generated
  • Loading branch information
g105b authored May 6, 2020
2 parents d316782 + 66ee23c commit f98b9eb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/HTMLDocumentProtector.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(
*/
public function protectAndInject(
string $tokenSharing = self::ONE_TOKEN_PER_PAGE
):void {
):string {
$forms = $this->document->forms;

if($forms->length > 0) {
Expand Down Expand Up @@ -121,6 +121,8 @@ public function protectAndInject(
}

$meta->setAttribute("content", $token);

return $token;
}

/**
Expand Down

0 comments on commit f98b9eb

Please sign in to comment.