[WIP] 2fa - Optimize code, views

This commit is contained in:
slawkens
2026-01-21 20:12:41 +01:00
parent 1975fb8ebe
commit 867e3e2c38
17 changed files with 208 additions and 105 deletions

View File

@@ -3,19 +3,11 @@ defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/../base.php';
$account = \MyAAC\Models\Account::find($account_logged->getId());
if (!$account) {
if (!$account_logged->isLoaded()) {
error('Account not found!');
return;
}
if ($db->hasColumn('accounts', 'secret')) {
$account->secret = NULL;
}
$account->{'2fa_secret'} = '';
$account->save();
$twoFactorAuth->disable();
$twig->display('success.html.twig', [