add 2fa manual option

This commit is contained in:
Austin 2021-11-13 18:04:08 -05:00
parent 646aea736e
commit a423c05a80
3 changed files with 11 additions and 5 deletions

View File

@ -5171,7 +5171,6 @@ function usingCustomThumbnail($id) //so the thumb doesnt break while rendering
function handleRenderPlace($placeid) //we have a 60 second wait, and we verify the render job was sent.
{
$assetinfo = getAssetInfo($placeid);
$creatorid = $assetinfo->CreatorId;
$lastrender = $assetinfo->lastPlaceRender;
if(($lastrender + (60)) < time()) //60 second interval

View File

@ -95,6 +95,12 @@ $body = <<<EOT
<img class="img-fluid w-100" id="settings_qrcode">
</div>
</div>
<div class="card">
<div class="card-body">
<h6>Authenticator Secret:</h6>
<code id="settings_auth_secret"></code>
</div>
</div>
</div>
<div class="col-sm">
<div class="row">
@ -244,11 +250,12 @@ function activate2FA(code)
});
}
function set2FAQR()
function setup2FA()
{
getJSONCDS("https://api.alphaland.cc/settings/twofactor/qr")
getJSONCDS("https://api.alphaland.cc/settings/twofactor/settings")
.done(function(object) {
$("#settings_qrcode").attr("src",object.qr);
$("#settings_auth_secret").html(object.secret);
});
}
@ -315,7 +322,7 @@ function initializeSettings()
if (object.twofactorenabled) {
twofactorEnabled();
} else {
set2FAQR();
setup2FA();
twofactorDisabled();
}

View File

@ -12,4 +12,4 @@ header('Content-Type: application/json');
$userid = $user->id;
die(json_encode(["qr"=>getUser2FAQR($userid)]));
die(json_encode(["qr"=>getUser2FAQR($userid),"secret"=>getUser2FASecret($userid)]));