mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
parent
307ad80358
commit
b7481096c8
2 changed files with 16 additions and 0 deletions
|
@ -742,6 +742,9 @@ class AuthComponent extends Component {
|
||||||
|
|
||||||
if (Router::normalize($redir) === Router::normalize($this->loginAction)) {
|
if (Router::normalize($redir) === Router::normalize($this->loginAction)) {
|
||||||
$redir = $this->loginRedirect;
|
$redir = $this->loginRedirect;
|
||||||
|
if (!$redir) {
|
||||||
|
$redir = '/';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} elseif ($this->loginRedirect) {
|
} elseif ($this->loginRedirect) {
|
||||||
$redir = $this->loginRedirect;
|
$redir = $this->loginRedirect;
|
||||||
|
|
|
@ -1652,6 +1652,19 @@ class AuthComponentTest extends CakeTestCase {
|
||||||
Router::reload();
|
Router::reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test that redirectUrl() returns '/' if loginRedirect is empty
|
||||||
|
* and Auth.redirect is the login page.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testRedirectUrlWithoutLoginRedirect() {
|
||||||
|
$this->Auth->Session->write('Auth.redirect', '/users/login');
|
||||||
|
$this->Auth->request->addParams(Router::parse('/users/login'));
|
||||||
|
$result = $this->Auth->redirectUrl();
|
||||||
|
$this->assertEquals('/', $result);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* test password hashing
|
* test password hashing
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue