Log out with a POST form.
The logout link put the CSRF token in the URL, which goes into logs and the browser history.
This commit is contained in:
@@ -85,7 +85,9 @@ class FrontPagesTest extends PageTestCase {
|
||||
$token = $this->loginAs();
|
||||
$body = $this->get('/')['body'];
|
||||
$this->assertStringContainsString('Secret', $body);
|
||||
$this->assertStringContainsString('<a href="/publish/logout?token=' . $token . '">Logout</a>', $body);
|
||||
$this->assertStringContainsString('<form action="/publish/logout" method="post"><input type="hidden" name="csrf_token" value="' . $token . '" />'
|
||||
. '<button type="submit">Logout</button></form>', $body);
|
||||
$this->assertStringNotContainsString('?token=', $body);
|
||||
$this->assertStringContainsString('<a href="/publish/addeditor">Add editor</a>', $body);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user