Description
Description
Why does Authentication\AuthenticationService::getUnauthenticatedRedirectUrl()
returns URLs without full base?
authentication/src/AuthenticationService.php
Line 398 in 6b6a2ef
This makes asserting redirects because of unauthenticated access a PITA.
$this->assertRedirect('/login?redirect=' . urlencode($redirect));
Leads to the following test error because of this:
Failed asserting that 'http://localhost/coupon-portal/login?redirect=%2Fcampaigns%2Fposition' equals content in header 'Location' (/coupon-portal/login?redirect=%2Fcampaigns%2Fposition).
Because Cake\TestSuite\IntegrationTestTrait::assertRedirect()
always tests against full based URLs:
Wouldn't full based URL redirects be more sensible (& secure) to begin with?
CakePHP Version
4.x & (probably) 5.x
PHP Version
irrelevant