mirror of
https://github.com/friendica/friendica
synced 2025-04-24 01:50:17 +00:00
Add the right exceptions for BaseUrl::redirect and respect them when catching exceptions at the Trust page
This commit is contained in:
parent
e4a83eafb8
commit
34f2b2f558
4 changed files with 23 additions and 2 deletions
|
@ -29,6 +29,9 @@ use Friendica\Core\Session\Capability\IHandleSessions;
|
|||
use Friendica\Model\User;
|
||||
use Friendica\Model\User\Cookie;
|
||||
use Friendica\Module\Response;
|
||||
use Friendica\Network\HTTPException\FoundException;
|
||||
use Friendica\Network\HTTPException\MovedPermanentlyException;
|
||||
use Friendica\Network\HTTPException\TemporaryRedirectException;
|
||||
use Friendica\Security\Authentication;
|
||||
use Friendica\Util\Profiler;
|
||||
use Friendica\Security\TwoFactor;
|
||||
|
@ -97,7 +100,10 @@ class Trust extends BaseModule
|
|||
|
||||
try {
|
||||
$this->auth->setForUser($this->app, User::getById($this->app->getLoggedInUserId()), true, true);
|
||||
} catch (\Exception $exception) {
|
||||
} catch (FoundException | TemporaryRedirectException | MovedPermanentlyException $e) {
|
||||
// exception wanted!
|
||||
throw $e;
|
||||
} catch (\Exception $e) {
|
||||
$this->logger->warning('Unexpected error during authentication.', ['user' => $this->app->getLoggedInUserId(), 'exception' => $exception]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue