mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-23 06:26:22 +01:00
[WIP] 2fa - Optimize code, views
This commit is contained in:
@@ -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', [
|
||||
|
||||
Reference in New Issue
Block a user