mirror of
https://github.com/friendica/friendica
synced 2025-04-19 13:10:10 +00:00
Replace BaseObject class with DI::* calls
This commit is contained in:
parent
1de3f186d7
commit
388b963714
98 changed files with 321 additions and 440 deletions
|
@ -7,7 +7,6 @@
|
|||
namespace Friendica\Module\Security;
|
||||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\App\Authentication;
|
||||
use Friendica\Core\Config;
|
||||
use Friendica\Core\Hook;
|
||||
use Friendica\Core\L10n;
|
||||
|
@ -49,15 +48,11 @@ class Login extends BaseModule
|
|||
) {
|
||||
$openid_url = trim(($_POST['openid_url'] ?? '') ?: $_POST['username']);
|
||||
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = self::getClass(Authentication::class);
|
||||
$authentication->withOpenId($openid_url, !empty($_POST['remember']));
|
||||
DI::auth()->withOpenId($openid_url, !empty($_POST['remember']));
|
||||
}
|
||||
|
||||
if (!empty($_POST['auth-params']) && $_POST['auth-params'] === 'login') {
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = self::getClass(Authentication::class);
|
||||
$authentication->withPassword(
|
||||
DI::auth()->withPassword(
|
||||
DI::app(),
|
||||
trim($_POST['username']),
|
||||
trim($_POST['password']),
|
||||
|
|
|
@ -42,10 +42,7 @@ class Recovery extends BaseModule
|
|||
Session::set('2fa', true);
|
||||
notice(L10n::t('Remaining recovery codes: %d', RecoveryCode::countValidForUser(local_user())));
|
||||
|
||||
// Resume normal login workflow
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = self::getClass(Authentication::class);
|
||||
$authentication->setForUser($a, $a->user, true, true);
|
||||
DI::auth()->setForUser($a, $a->user, true, true);
|
||||
} else {
|
||||
notice(L10n::t('Invalid code, please retry.'));
|
||||
}
|
||||
|
|
|
@ -40,9 +40,7 @@ class Verify extends BaseModule
|
|||
Session::set('2fa', $code);
|
||||
|
||||
// Resume normal login workflow
|
||||
/** @var Authentication $authentication */
|
||||
$authentication = self::getClass(Authentication::class);
|
||||
$authentication->setForUser($a, $a->user, true, true);
|
||||
DI::auth()->setForUser($a, $a->user, true, true);
|
||||
} else {
|
||||
self::$errors[] = L10n::t('Invalid code, please retry.');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue