Skip to content

Commit

Permalink
Merge branch 'release/1.1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
adrenth committed Jun 8, 2020
2 parents 5aefabb + 346d9c5 commit edf0a65
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion middleware/VerifyCsrfTokenMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Illuminate\Routing\Redirector;
use October\Rain\Cookie\Middleware\EncryptCookies;
use RuntimeException;
use Throwable;

/**
* Class VerifyCsrfTokenMiddleware
Expand Down Expand Up @@ -124,6 +125,10 @@ private function getTokenFromRequest(Request $request): string
$token = $this->encrypter->decrypt($header, EncryptCookies::serialized('XSRF-TOKEN'));
}

return (string) $token;
try {
return (string) $token;
} catch (Throwable $e) {
return '';
}
}
}
1 change: 1 addition & 0 deletions updates/version.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
1.0.0: "First version of Vdlp.Csrf -- See: https://github.com/vdlp/oc-csrf-plugin/releases/tag/1.0.0"
1.1.0: "Added configuration to exclude paths from CSRF validation -- See: https://github.com/vdlp/oc-csrf-plugin/releases/tag/1.1.0"
1.1.1: "Prevent error on CSRF token conversion -- See: https://github.com/vdlp/oc-csrf-plugin/releases/tag/1.1.1"

0 comments on commit edf0a65

Please sign in to comment.