mirror of
https://github.com/friendica/friendica
synced 2025-04-24 01:50:17 +00:00
Refactor Security\Authentication class, remove dependency for App instance
This commit is contained in:
parent
c0bd3b5ff0
commit
00d2e24dd2
8 changed files with 21 additions and 22 deletions
|
@ -59,7 +59,7 @@ class Recovery extends BaseModule
|
|||
$this->session->set('2fa', true);
|
||||
DI::sysmsg()->addInfo($this->t('Remaining recovery codes: %d', RecoveryCode::countValidForUser($this->session->getLocalUserId())));
|
||||
|
||||
$this->auth->setForUser($this->app, User::getById($this->session->getLocalUserId()), true, true);
|
||||
$this->auth->setForUser(User::getById($this->session->getLocalUserId()), true, true);
|
||||
|
||||
$this->baseUrl->redirect($this->session->pop('return_path', ''));
|
||||
} else {
|
||||
|
|
|
@ -88,7 +88,7 @@ class Trust extends BaseModule
|
|||
}
|
||||
|
||||
try {
|
||||
$this->auth->setForUser($this->app, User::getById($this->session->getLocalUserId()), true, true);
|
||||
$this->auth->setForUser(User::getById($this->session->getLocalUserId()), true, true);
|
||||
$this->baseUrl->redirect($this->session->pop('return_path', ''));
|
||||
} catch (FoundException | TemporaryRedirectException | MovedPermanentlyException $e) {
|
||||
// exception wanted!
|
||||
|
@ -109,7 +109,7 @@ class Trust extends BaseModule
|
|||
try {
|
||||
$trustedBrowser = $this->trustedBrowserRepository->selectOneByHash($this->cookie->get('2fa_cookie_hash'));
|
||||
if (!$trustedBrowser->trusted) {
|
||||
$this->auth->setForUser($this->app, User::getById($this->session->getLocalUserId()), true, true);
|
||||
$this->auth->setForUser(User::getById($this->session->getLocalUserId()), true, true);
|
||||
$this->baseUrl->redirect($this->session->pop('return_path', ''));
|
||||
}
|
||||
} catch (TrustedBrowserNotFoundException $exception) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue