diff --git a/cloud/src/Security/Csrf.php b/cloud/src/Security/Csrf.php new file mode 100644 index 0000000..2f0e643 --- /dev/null +++ b/cloud/src/Security/Csrf.php @@ -0,0 +1,11 @@ +assertNotSame('s3cret!', $h); + $this->assertTrue(Password::verify('s3cret!', $h)); + $this->assertFalse(Password::verify('wrong', $h)); + } + public function testCsrf(): void { + $t = Csrf::issue(fn() => 'abc123'); + $this->assertSame('abc123', $t); + $this->assertTrue(Csrf::check($t, 'abc123')); + $this->assertFalse(Csrf::check($t, 'nope')); + } +}