mirror of
https://github.com/itflow-org/itflow
synced 2026-03-02 03:44:53 +00:00
Guest login sharing - OTP
Bugfix: Fix guests not being able to see the 2FA/TOTP token via the sharing link https://forum.itflow.org/d/646-shared-login-with-otp
This commit is contained in:
@@ -10,6 +10,8 @@ require_once "config.php";
|
|||||||
|
|
||||||
require_once "functions.php";
|
require_once "functions.php";
|
||||||
|
|
||||||
|
require_once "rfc6238.php";
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Creates & Returns a Stripe Payment Intent for a particular invoice ID
|
* Creates & Returns a Stripe Payment Intent for a particular invoice ID
|
||||||
@@ -119,3 +121,9 @@ if (isset($_GET['stripe_create_pi'])) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($_GET['get_totp_token'])) {
|
||||||
|
$otp = TokenAuth6238::getTokenCode(strtoupper($_GET['totp_secret']));
|
||||||
|
|
||||||
|
echo json_encode($otp);
|
||||||
|
}
|
||||||
|
|||||||
@@ -201,9 +201,9 @@ if ($item_type == "Document") {
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
function showOTP(id, secret) {
|
function showOTP(id, secret) {
|
||||||
//Send a GET request to ajax.php as ajax.php?get_totp_token=true&totp_secret=SECRET
|
//Send a GET request to ajax.php as guest_ajax.php?get_totp_token=true&totp_secret=SECRET
|
||||||
jQuery.get(
|
jQuery.get(
|
||||||
"ajax.php",
|
"guest_ajax.php",
|
||||||
{get_totp_token: 'true', totp_secret: secret},
|
{get_totp_token: 'true', totp_secret: secret},
|
||||||
function(data) {
|
function(data) {
|
||||||
//If we get a response from post.php, parse it as JSON
|
//If we get a response from post.php, parse it as JSON
|
||||||
|
|||||||
Reference in New Issue
Block a user