Skip to content

Commit

Permalink
get token from request cookies alternatively - closes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
dneustadt authored Nov 12, 2020
1 parent 6c3f875 commit 8bb0796
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Service/CsrfRequestEvaluator.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ public function getHeader(Request $request, ?Response $response): void

public function isTokenValid(Request $request, bool $throwException = true): bool
{
$token = $request->headers->get($this->cookieHeader);
$token = $request->headers->has($this->cookieHeader) ?
$request->headers->get($this->cookieHeader) :
$request->cookies->get($this->cookieHeader);

if (empty($token)) {
if ($throwException === false) {
Expand Down

0 comments on commit 8bb0796

Please sign in to comment.