Add 'Show QR code' feature to the manage view

This commit is contained in:
Bubka 2020-11-02 13:39:43 +01:00
parent 53bb3b9c54
commit 7a3f9b526f
9 changed files with 732 additions and 14 deletions

View File

@ -2,17 +2,39 @@
namespace App\Http\Controllers;
use Zxing\QrReader;
use OTPHP\TOTP;
use OTPHP\Factory;
use Zxing\QrReader;
use App\TwoFAccount;
use chillerlan\QRCode\{QRCode, QROptions};
use App\Classes\Options;
use Assert\AssertionFailedException;
use Illuminate\Http\File;
use Illuminate\Http\Request;
use Assert\AssertionFailedException;
use Illuminate\Support\Facades\Storage;
class QrCodeController extends Controller
{
/**
* Return a QR code image
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function show(TwoFAccount $twofaccount)
{
$options = new QROptions([
'quietzoneSize' => 2,
'scale' => 8,
]);
$qrcode = new QRCode($options);
return response()->json(['qrcode' => $qrcode->render($twofaccount->uri)], 200);
}
/**
* Handle uploaded qr code image
*

View File

@ -10,6 +10,7 @@
"require": {
"php": "^7.3",
"appstract/laravel-options": "^4.1.1",
"chillerlan/php-qrcode": "3.3",
"doctrine/dbal": "^2.10",
"fideloper/proxy": "^4.2",
"khanamiryan/qrcode-detector-decoder": "^1.0",

643
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "99c96c72beb6cd79e6fde6c919bb341f",
"content-hash": "3c69e684e02cda09c9d406a12a83ff42",
"packages": [
{
"name": "appstract/laravel-options",
@ -174,8 +174,131 @@
"brick",
"math"
],
"funding": [
{
"url": "https://tidelift.com/funding/github/packagist/brick/math",
"type": "tidelift"
}
],
"time": "2020-08-18T23:57:15+00:00"
},
{
"name": "chillerlan/php-qrcode",
"version": "3.3.0",
"source": {
"type": "git",
"url": "https://github.com/chillerlan/php-qrcode.git",
"reference": "c8fcb2d0435279421fa03f6a3f217ccae9bddd59"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-qrcode/zipball/c8fcb2d0435279421fa03f6a3f217ccae9bddd59",
"reference": "c8fcb2d0435279421fa03f6a3f217ccae9bddd59",
"shasum": ""
},
"require": {
"chillerlan/php-settings-container": "^1.2",
"ext-mbstring": "*",
"php": "^7.2"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"setasign/fpdf": "^1.8.2"
},
"suggest": {
"chillerlan/php-authenticator": "Yet another Google authenticator! Also creates URIs for mobile apps.",
"setasign/fpdf": "Required to use the QR FPDF output."
},
"type": "library",
"autoload": {
"psr-4": {
"chillerlan\\QRCode\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Kazuhiko Arase",
"homepage": "https://github.com/kazuhikoarase"
},
{
"name": "Smiley",
"email": "smiley@chillerlan.net",
"homepage": "https://github.com/codemasher"
},
{
"name": "Contributors",
"homepage": "https://github.com/chillerlan/php-qrcode/graphs/contributors"
}
],
"description": "A QR code generator. PHP 7.2+",
"homepage": "https://github.com/chillerlan/php-qrcode",
"keywords": [
"phpqrcode",
"qr",
"qr code",
"qrcode",
"qrcode-generator"
],
"funding": [
{
"url": "https://ko-fi.com/codemasher",
"type": "ko_fi"
}
],
"time": "2020-06-04T16:47:37+00:00"
},
{
"name": "chillerlan/php-settings-container",
"version": "1.2.1",
"source": {
"type": "git",
"url": "https://github.com/chillerlan/php-settings-container.git",
"reference": "b9b0431dffd74102ee92348a63b4c33fc8ba639b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/chillerlan/php-settings-container/zipball/b9b0431dffd74102ee92348a63b4c33fc8ba639b",
"reference": "b9b0431dffd74102ee92348a63b4c33fc8ba639b",
"shasum": ""
},
"require": {
"ext-json": "*",
"php": "^7.2"
},
"require-dev": {
"phpunit/phpunit": "^8.3"
},
"type": "library",
"autoload": {
"psr-4": {
"chillerlan\\Settings\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Smiley",
"email": "smiley@chillerlan.net",
"homepage": "https://github.com/codemasher"
}
],
"description": "A container class for immutable settings objects. Not a DI container. PHP 7.2+",
"homepage": "https://github.com/chillerlan/php-settings-container",
"keywords": [
"PHP7",
"Settings",
"container",
"helper"
],
"time": "2019-09-10T00:09:44+00:00"
},
{
"name": "defuse/php-encryption",
"version": "v2.2.1",
@ -612,6 +735,20 @@
"uppercase",
"words"
],
"funding": [
{
"url": "https://www.doctrine-project.org/sponsorship.html",
"type": "custom"
},
{
"url": "https://www.patreon.com/phpdoctrine",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/doctrine%2Finflector",
"type": "tidelift"
}
],
"time": "2020-05-29T15:13:26+00:00"
},
{
@ -970,6 +1107,24 @@
"rest",
"web service"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://github.com/Nyholm",
"type": "github"
},
{
"url": "https://github.com/alexeyshockov",
"type": "github"
},
{
"url": "https://github.com/gmponos",
"type": "github"
}
],
"time": "2020-10-10T11:47:56+00:00"
},
{
@ -1227,6 +1382,12 @@
"psr-17",
"psr-7"
],
"funding": [
{
"url": "https://funding.communitybridge.org/projects/laminas-project",
"type": "community_bridge"
}
],
"time": "2020-09-03T14:29:41+00:00"
},
{
@ -1275,6 +1436,12 @@
"laminas",
"zf"
],
"funding": [
{
"url": "https://funding.communitybridge.org/projects/laminas-project",
"type": "community_bridge"
}
],
"time": "2020-09-14T14:23:00+00:00"
},
{
@ -2002,6 +2169,12 @@
"secure",
"server"
],
"funding": [
{
"url": "https://github.com/sephster",
"type": "github"
}
],
"time": "2020-07-01T11:33:50+00:00"
},
{
@ -2083,6 +2256,16 @@
"logging",
"psr-3"
],
"funding": [
{
"url": "https://github.com/Seldaek",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/monolog/monolog",
"type": "tidelift"
}
],
"time": "2020-07-23T08:41:23+00:00"
},
{
@ -2277,6 +2460,16 @@
"psr-17",
"psr-7"
],
"funding": [
{
"url": "https://github.com/Zegnat",
"type": "github"
},
{
"url": "https://github.com/nyholm",
"type": "github"
}
],
"time": "2020-06-13T15:59:10+00:00"
},
{
@ -3157,6 +3350,12 @@
"queue",
"set"
],
"funding": [
{
"url": "https://github.com/ramsey",
"type": "github"
}
],
"time": "2020-09-10T20:58:17+00:00"
},
{
@ -3238,6 +3437,12 @@
"identifier",
"uuid"
],
"funding": [
{
"url": "https://github.com/ramsey",
"type": "github"
}
],
"time": "2020-08-18T17:17:46+00:00"
},
{
@ -3297,6 +3502,12 @@
"sort",
"sortable"
],
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2020-09-15T06:48:07+00:00"
},
{
@ -3509,6 +3720,20 @@
],
"description": "Symfony Console Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-07T15:23:00+00:00"
},
{
@ -3562,6 +3787,20 @@
],
"description": "Symfony CssSelector Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-05-20T17:43:50+00:00"
},
{
@ -3612,6 +3851,20 @@
],
"description": "A generic function and convention to trigger deprecation notices",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-07T11:33:47+00:00"
},
{
@ -3669,6 +3922,20 @@
],
"description": "Symfony ErrorHandler Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-02T08:49:02+00:00"
},
{
@ -3742,6 +4009,20 @@
],
"description": "Symfony EventDispatcher Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-18T14:27:32+00:00"
},
{
@ -3804,6 +4085,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-07T11:33:47+00:00"
},
{
@ -3853,6 +4148,20 @@
],
"description": "Symfony Finder Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-02T16:23:27+00:00"
},
{
@ -3976,6 +4285,20 @@
],
"description": "Symfony HttpFoundation Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-27T14:14:57+00:00"
},
{
@ -4076,6 +4399,20 @@
],
"description": "Symfony HttpKernel Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-04T07:57:28+00:00"
},
{
@ -4139,6 +4476,20 @@
"mime",
"mime-type"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-02T16:23:27+00:00"
},
{
@ -4328,6 +4679,20 @@
"portable",
"shim"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-07-14T12:35:20+00:00"
},
{
@ -4829,6 +5194,20 @@
],
"description": "Symfony Process Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-02T16:23:27+00:00"
},
{
@ -4893,6 +5272,20 @@
"psr-17",
"psr-7"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-29T08:17:46+00:00"
},
{
@ -4971,6 +5364,20 @@
"uri",
"url"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-10-02T13:05:43+00:00"
},
{
@ -5104,6 +5511,20 @@
"utf-8",
"utf8"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-15T12:23:47+00:00"
},
{
@ -5182,6 +5603,20 @@
],
"description": "Symfony Translation Component",
"homepage": "https://symfony.com",
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-27T03:44:28+00:00"
},
{
@ -5243,6 +5678,20 @@
"interoperability",
"standards"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-28T13:05:58+00:00"
},
{
@ -5319,6 +5768,20 @@
"debug",
"dump"
],
"funding": [
{
"url": "https://symfony.com/sponsor",
"type": "custom"
},
{
"url": "https://github.com/fabpot",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/symfony/symfony",
"type": "tidelift"
}
],
"time": "2020-09-18T14:27:32+00:00"
},
{
@ -5567,6 +6030,16 @@
"env",
"environment"
],
"funding": [
{
"url": "https://github.com/GrahamCampbell",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/vlucas/phpdotenv",
"type": "tidelift"
}
],
"time": "2020-07-14T19:22:52+00:00"
},
{
@ -5615,6 +6088,28 @@
"clean",
"php"
],
"funding": [
{
"url": "https://www.paypal.me/moelleken",
"type": "custom"
},
{
"url": "https://github.com/voku",
"type": "github"
},
{
"url": "https://opencollective.com/portable-ascii",
"type": "open_collective"
},
{
"url": "https://www.patreon.com/voku",
"type": "patreon"
},
{
"url": "https://tidelift.com/funding/github/packagist/voku/portable-ascii",
"type": "tidelift"
}
],
"time": "2020-07-22T23:32:04+00:00"
}
],
@ -5728,6 +6223,12 @@
"flare",
"reporting"
],
"funding": [
{
"url": "https://github.com/spatie",
"type": "github"
}
],
"time": "2020-09-18T06:35:11+00:00"
},
{
@ -6193,6 +6694,20 @@
"php",
"symfony"
],
"funding": [
{
"url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L",
"type": "custom"
},
{
"url": "https://github.com/nunomaduro",
"type": "github"
},
{
"url": "https://www.patreon.com/nunomaduro",
"type": "patreon"
}
],
"time": "2020-04-04T19:56:08+00:00"
},
{
@ -6572,6 +7087,12 @@
"testing",
"xunit"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-10-02T03:37:32+00:00"
},
{
@ -6622,6 +7143,12 @@
"filesystem",
"iterator"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:57:25+00:00"
},
{
@ -6675,6 +7202,12 @@
"keywords": [
"process"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:58:55+00:00"
},
{
@ -6724,6 +7257,12 @@
"keywords": [
"template"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:03:05+00:00"
},
{
@ -6773,6 +7312,12 @@
"keywords": [
"timer"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:00:25+00:00"
},
{
@ -6977,6 +7522,12 @@
],
"description": "Library for parsing CLI options",
"homepage": "https://github.com/sebastianbergmann/cli-parser",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:08:49+00:00"
},
{
@ -7023,6 +7574,12 @@
],
"description": "Collection of value objects that represent the PHP code units",
"homepage": "https://github.com/sebastianbergmann/code-unit",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-10-02T14:47:54+00:00"
},
{
@ -7068,6 +7625,12 @@
],
"description": "Looks up which function or method a line of code belongs to",
"homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:30:19+00:00"
},
{
@ -7132,6 +7695,12 @@
"compare",
"equality"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-30T06:47:25+00:00"
},
{
@ -7179,6 +7748,12 @@
],
"description": "Library for calculating the complexity of PHP code units",
"homepage": "https://github.com/sebastianbergmann/complexity",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:05:03+00:00"
},
{
@ -7235,6 +7810,12 @@
"unidiff",
"unified diff"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:32:55+00:00"
},
{
@ -7288,6 +7869,12 @@
"environment",
"hhvm"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:52:38+00:00"
},
{
@ -7355,6 +7942,12 @@
"export",
"exporter"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:24:23+00:00"
},
{
@ -7409,6 +8002,12 @@
"keywords": [
"global state"
],
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:54:06+00:00"
},
{
@ -7456,6 +8055,12 @@
],
"description": "Library for counting the lines of code in PHP source code",
"homepage": "https://github.com/sebastianbergmann/lines-of-code",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:07:27+00:00"
},
{
@ -7503,6 +8108,12 @@
],
"description": "Traverses array structures and object graphs to enumerate all referenced objects",
"homepage": "https://github.com/sebastianbergmann/object-enumerator/",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:55:06+00:00"
},
{
@ -7548,6 +8159,12 @@
],
"description": "Allows reflection of object attributes, including inherited and non-public ones",
"homepage": "https://github.com/sebastianbergmann/object-reflector/",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:56:16+00:00"
},
{
@ -7601,6 +8218,12 @@
],
"description": "Provides functionality to recursively process PHP variables",
"homepage": "http://www.github.com/sebastianbergmann/recursion-context",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T05:17:32+00:00"
},
{
@ -7646,6 +8269,12 @@
],
"description": "Provides a list of PHP built-in functions that operate on resources",
"homepage": "https://www.github.com/sebastianbergmann/resource-operations",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:45:17+00:00"
},
{
@ -7692,6 +8321,12 @@
],
"description": "Collection of value objects that represent the types of the PHP type system",
"homepage": "https://github.com/sebastianbergmann/type",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-10-06T08:41:03+00:00"
},
{
@ -7735,6 +8370,12 @@
],
"description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version",
"funding": [
{
"url": "https://github.com/sebastianbergmann",
"type": "github"
}
],
"time": "2020-09-28T06:39:44+00:00"
},
{

View File

@ -6,6 +6,7 @@ Vue.use(Router)
import Accounts from './views/Accounts'
import CreateAccount from './views/twofaccounts/Create'
import EditAccount from './views/twofaccounts/Edit'
import QRcodeAccount from './views/twofaccounts/QRcode'
import Groups from './views/Groups'
import CreateGroup from './views/groups/Create'
import EditGroup from './views/groups/Edit'
@ -22,6 +23,7 @@ const router = new Router({
{ path: '/accounts', name: 'accounts', component: Accounts, meta: { requiresAuth: true }, alias: '/', props: true },
{ path: '/account/create', name: 'createAccount', component: CreateAccount, meta: { requiresAuth: true } },
{ path: '/account/edit/:twofaccountId', name: 'editAccount', component: EditAccount, meta: { requiresAuth: true } },
{ path: '/account/qrcode/:twofaccountId', name: 'showQRcode', component: QRcodeAccount, meta: { requiresAuth: true } },
{ path: '/groups', name: 'groups', component: Groups, meta: { requiresAuth: true }, props: true },
{ path: '/group/create', name: 'createGroup', component: CreateGroup, meta: { requiresAuth: true } },

View File

@ -66,9 +66,14 @@
</div>
<transition name="fadeInOut">
<div class="tfa-edit has-text-grey" v-if="editMode">
<router-link :to="{ name: 'editAccount', params: { twofaccountId: account.id }}" class="tag is-dark is-rounded">
{{ $t('commons.edit') }}
</router-link>
<!-- <div class="tags has-addons"> -->
<router-link :to="{ name: 'editAccount', params: { twofaccountId: account.id }}" class="tag is-dark is-rounded mr-1">
{{ $t('commons.edit') }}
</router-link>
<router-link :to="{ name: 'showQRcode', params: { twofaccountId: account.id }}" class="tag is-dark is-rounded" :title="$t('twofaccounts.show_qrcode')">
<font-awesome-icon :icon="['fas', 'qrcode']" />
</router-link>
<!-- </div> -->
</div>
</transition>
<transition name="fadeInOut">

View File

@ -0,0 +1,45 @@
<template>
<div class="modal modal-otp is-active">
<div class="modal-background"></div>
<div class="modal-content">
<p class="has-text-centered m-5">
<img :src="qrcode" class="has-background-light">
</p>
</div>
<div class="fullscreen-footer">
<!-- Close button -->
<label class="button is-dark is-rounded" @click.stop="$router.push({name: 'accounts', params: { InitialEditMode: true }});">
{{ $t('commons.close') }}
</label>
</div>
</div>
</template>
<script>
export default {
data() {
return {
qrcode: null,
}
},
mounted: function() {
this.getQRcode()
},
methods: {
async getQRcode () {
const { data } = await this.axios.get('/api/qrcode/' + this.$route.params.twofaccountId)
this.qrcode = data.qrcode
},
}
}
</script>

View File

@ -21,6 +21,7 @@
'add_first_account' => 'Add your first account',
'use_full_form' => 'Or use the full form',
'add_one' => 'Add one',
'show_qrcode' => 'Show QR code',
'forms' => [
'service' => [
'placeholder' => 'example.com',

View File

@ -163,13 +163,13 @@ a:hover {
padding: 0;
}
.tfa-list .tfa-container > div:first-of-type {
padding: 0 0 0 0.5rem;
}
// .tfa-list .tfa-container > div:first-of-type {
// padding: 0 0 0 0.5rem;
// }
.tfa-list .tfa-container > div:last-of-type {
padding: 0 1rem 0 0;
}
// .tfa-list .tfa-container > div:last-of-type {
// padding: 0 1rem 0 0;
// }
.tfa-grid .tfa-checkbox,
.tfa-grid .tfa-dots,
@ -620,7 +620,7 @@ footer .field.is-grouped {
@keyframes addLeftOffset {
from {
transform: translateX(-2.875rem);
transform: translateX(-2.375rem);
}
to {
transform: translateX(0);
@ -664,7 +664,7 @@ footer .field.is-grouped {
transform: translateX(0);
}
to {
transform: translateX(-2.875rem);
transform: translateX(-2.375rem);
}
}

View File

@ -43,6 +43,7 @@
Route::apiResource('groups', 'GroupController');
Route::post('twofaccounts/otp', 'TwoFAccountController@generateOTP')->name('twofaccounts.generateOTP');
Route::post('qrcode/decode', 'QrCodeController@decode');
Route::get('qrcode/{twofaccount}', 'QrCodeController@show');
Route::post('icon/upload', 'IconController@upload');
Route::delete('icon/delete/{icon}', 'IconController@delete');