mirror of
https://github.com/slawkens/myaac.git
synced 2026-01-20 13:16:23 +01:00
[WIP] Working app auth (Still not ready)
Missing rec key validation Doesn't work with google recaptcha plugin
This commit is contained in:
24
system/pages/account/2fa/app/disable.php
Normal file
24
system/pages/account/2fa/app/disable.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?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.'
|
||||
]);
|
||||
Reference in New Issue
Block a user