Skip to content

Commit

Permalink
Renamed handling method in the trait LogoutPresenterTrait to avoid …
Browse files Browse the repository at this point in the history
…conflict with newer Nette/Application package
  • Loading branch information
tg666 committed Oct 7, 2024
1 parent eedfa17 commit 8c37e4e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/UserBundle/Bridge/Nette/Ui/LogoutPresenterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public function startup(): void
assert($user instanceof NetteUser);

if (!$user->isLoggedIn()) {
$this->handleUserNotLoggedIn();
$this->userNotLoggedInHandler();
}

if ($this->getParameter($this->tokenName) !== $this->csrfTokenFactory->create(static::class)) {
$this->handleInvalidToken();
$this->invalidTokenHandler();
}

$user->logout();
$this->handleUserLoggedOut();
$this->userLoggedOutHandler();

throw new InvalidStateException(sprintf(
'Method %s::handleUserLoggedOut() must redirect when the user is logged out.',
Expand All @@ -69,14 +69,14 @@ public function startup(): void
*
* @throws AbortException
*/
abstract protected function handleUserLoggedOut(): void;
abstract protected function userLoggedOutHandler(): void;

/**
* Use can override the default behavior
*
* @throws ForbiddenRequestException
*/
protected function handleUserNotLoggedIn(): void
protected function userNotLoggedInHandler(): void
{
throw new ForbiddenRequestException('');
}
Expand All @@ -86,7 +86,7 @@ protected function handleUserNotLoggedIn(): void
*
* @throws ForbiddenRequestException
*/
protected function handleInvalidToken(): void
protected function invalidTokenHandler(): void
{
throw new ForbiddenRequestException('');
}
Expand Down

0 comments on commit 8c37e4e

Please sign in to comment.