fix: CSRF flow ships the raw token, not the HMAC cookie
This commit is contained in:
@@ -39,7 +39,7 @@ final class PostTeamEditorTest extends TestCase
|
||||
$handler = new PostTeamEditor();
|
||||
$request = $this->buildRequest(
|
||||
post: $this->validPost($token),
|
||||
cookies: ['__csrf' => $cookie],
|
||||
cookies: ['__csrf' => $cookie, '__csrf_token' => $token],
|
||||
server: ['__csrf_secret' => self::SECRET],
|
||||
);
|
||||
$response = $handler->handle($request, ['id' => 'demo']);
|
||||
@@ -57,7 +57,7 @@ final class PostTeamEditorTest extends TestCase
|
||||
$post['teamA']['units'][0]['maxHealth'] = '9999';
|
||||
$request = $this->buildRequest(
|
||||
post: $post,
|
||||
cookies: ['__csrf' => $cookie],
|
||||
cookies: ['__csrf' => $cookie, '__csrf_token' => $token],
|
||||
server: ['__csrf_secret' => self::SECRET],
|
||||
);
|
||||
$response = $handler->handle($request, ['id' => 'demo']);
|
||||
@@ -75,7 +75,7 @@ final class PostTeamEditorTest extends TestCase
|
||||
$post['id'] = '</script><script>alert(1)</script>';
|
||||
$request = $this->buildRequest(
|
||||
post: $post,
|
||||
cookies: ['__csrf' => $cookie],
|
||||
cookies: ['__csrf' => $cookie, '__csrf_token' => $token],
|
||||
server: ['__csrf_secret' => self::SECRET],
|
||||
);
|
||||
$response = $handler->handle($request, ['id' => $post['id']]);
|
||||
|
||||
Reference in New Issue
Block a user