Files
myaac/system/pages/account/2fa/app/disable.php
slawkens 21e2eed640 [WIP] Working app auth (Still not ready)
Missing rec key validation
Doesn't work with google recaptcha plugin
2026-01-18 21:45:50 +01:00

25 lines
504 B
PHP

<?php
defined('MYAAC') or die('Direct access not allowed!');
require __DIR__ . '/../base.php';
$account = \MyAAC\Models\Account::find($account_logged->getId());
if (!$account) {
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', [
'title' => 'Disabled',
'description' => 'Two Factor Authentication has been disabled.'
]);