diff --git a/rfc6238.php b/rfc6238.php index 0468bde3..a4a7c0e5 100644 --- a/rfc6238.php +++ b/rfc6238.php @@ -58,10 +58,10 @@ return $result; } - public static function getBarCodeUrl($username, $domain, $secretkey, $issuer) { + public static function getBarCodeUrl($app_name, $email, $secretkey, $issuer) { $url = "http://chart.apis.google.com/chart"; $url = $url."?chs=200x200&chld=M|0&cht=qr&chl=otpauth://totp/"; - $url = $url.$username . "@" . $domain . "%3Fsecret%3D" . $secretkey . '%26issuer%3D' . rawurlencode($issuer); + $url = $url.$app_name . ": " . $email . "%3Fsecret%3D" . $secretkey . '%26issuer%3D' . rawurlencode($issuer); return $url; } diff --git a/user_profile.php b/user_profile.php index e8245fbb..7b9576be 100644 --- a/user_profile.php +++ b/user_profile.php @@ -111,7 +111,7 @@ $sql_recent_logs = mysqli_query($mysqli, "SELECT * FROM logs if (!empty($session_token)) { //Generate QR Code based off the generated key - print sprintf('',TokenAuth6238::getBarCodeUrl($session_name,' ',$session_token,$_SERVER['SERVER_NAME'])); + print sprintf('',TokenAuth6238::getBarCodeUrl($config_app_name, $session_email, $session_token, $_SERVER['SERVER_NAME'])); echo "

$session_token

"; }