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. function handleRenderPlace($placeid) //we have a 60 second wait, and we verify the render job was sent.
{ {
$assetinfo = getAssetInfo($placeid); $assetinfo = getAssetInfo($placeid);
$creatorid = $assetinfo->CreatorId;
$lastrender = $assetinfo->lastPlaceRender; $lastrender = $assetinfo->lastPlaceRender;
if(($lastrender + (60)) < time()) //60 second interval if(($lastrender + (60)) < time()) //60 second interval

View File

@ -95,6 +95,12 @@ $body = <<<EOT
<img class="img-fluid w-100" id="settings_qrcode"> <img class="img-fluid w-100" id="settings_qrcode">
</div> </div>
</div> </div>
<div class="card">
<div class="card-body">
<h6>Authenticator Secret:</h6>
<code id="settings_auth_secret"></code>
</div>
</div>
</div> </div>
<div class="col-sm"> <div class="col-sm">
<div class="row"> <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) { .done(function(object) {
$("#settings_qrcode").attr("src",object.qr); $("#settings_qrcode").attr("src",object.qr);
$("#settings_auth_secret").html(object.secret);
}); });
} }
@ -315,7 +322,7 @@ function initializeSettings()
if (object.twofactorenabled) { if (object.twofactorenabled) {
twofactorEnabled(); twofactorEnabled();
} else { } else {
set2FAQR(); setup2FA();
twofactorDisabled(); twofactorDisabled();
} }

View File

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