From 0590c5e169d07c3ff4d92fd94e47ab16f12798a7 Mon Sep 17 00:00:00 2001 From: Benjamin Takats Date: Wed, 18 Jan 2023 14:07:46 +0100 Subject: [PATCH] getalby clickable --- app/Http/Livewire/Auth/LNUrlAuth.php | 8 ++++-- docker/8.1/Dockerfile | 2 +- resources/lang/de.json | 3 +- resources/lang/en.json | 3 +- .../views/livewire/auth/ln-url-auth.blade.php | 28 ++++++++++++++++--- 5 files changed, 34 insertions(+), 10 deletions(-) diff --git a/app/Http/Livewire/Auth/LNUrlAuth.php b/app/Http/Livewire/Auth/LNUrlAuth.php index f949feb5..fbf88ab8 100644 --- a/app/Http/Livewire/Auth/LNUrlAuth.php +++ b/app/Http/Livewire/Auth/LNUrlAuth.php @@ -2,7 +2,6 @@ namespace App\Http\Livewire\Auth; -use App\Gamify\Points\LoggedIn; use App\Models\LoginKey; use App\Models\User; use App\Notifications\ModelCreatedNotification; @@ -32,8 +31,11 @@ class LNUrlAuth extends Component $this->k1 = bin2hex(str()->random(32)); $this->url = url('/api/lnurl-auth-callback?tag=login&k1='.$this->k1.'&action=login'); $this->lnurl = lnurl\encodeUrl($this->url); - $this->qrCode = QrCode::size(300) - ->generate($this->lnurl); + $this->qrCode = base64_encode(QrCode::format('png') + ->size(300) + ->merge('/public/android-chrome-192x192.png', .3) + ->errorCorrection('H') + ->generate($this->lnurl)); } public function checkAuth() diff --git a/docker/8.1/Dockerfile b/docker/8.1/Dockerfile index 9343b645..c1fe52cd 100644 --- a/docker/8.1/Dockerfile +++ b/docker/8.1/Dockerfile @@ -31,7 +31,7 @@ RUN apt-get update \ php8.1-intl php8.1-readline \ php8.1-ldap php8.1-gmp \ php8.1-msgpack php8.1-igbinary php8.1-redis php8.1-swoole \ - php8.1-memcached php8.1-pcov php8.1-xdebug \ + php8.1-memcached php8.1-pcov php8.1-xdebug php8.1-imagick \ && php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer \ && curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash - \ && apt-get install -y nodejs \ diff --git a/resources/lang/de.json b/resources/lang/de.json index d53e758c..80a0ac45 100644 --- a/resources/lang/de.json +++ b/resources/lang/de.json @@ -659,5 +659,6 @@ "Your current Meetup groups": "Deine aktuellen Meetup-Gruppen", "Thanks, continue here": "Danke, weiter geht es hier", "Copy the LNURL and paste it under \"Send\" or scan the QR code with \"Send\". LNURL-auth enabled wallets:": "Kopiere die LNURL und füge sie unter \"Senden\" ein oder scanne den QR-Code mit \"Senden\". LNURL-auth fähige Wallets:", - "Without @": "Ohne @" + "Without @": "Ohne @", + "Scan this code or copy + paste it to your lightning wallet. Or click to login with your browser's wallet.": "Scanne diesen Code oder copy + paste ihn in deine Lightning-Wallet ein. Oder klicke, um dich mit der Wallet deines Browsers anzumelden." } diff --git a/resources/lang/en.json b/resources/lang/en.json index 9e105217..9b2e3765 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -652,5 +652,6 @@ "Your current Meetup groups": "", "Thanks, continue here": "", "Copy the LNURL and paste it under \"Send\" or scan the QR code with \"Send\". LNURL-auth enabled wallets:": "", - "Without @": "" + "Without @": "", + "Scan this code or copy + paste it to your lightning wallet. Or click to login with your browser's wallet.": "" } diff --git a/resources/views/livewire/auth/ln-url-auth.blade.php b/resources/views/livewire/auth/ln-url-auth.blade.php index d4d29ad6..532a84d8 100644 --- a/resources/views/livewire/auth/ln-url-auth.blade.php +++ b/resources/views/livewire/auth/ln-url-auth.blade.php @@ -13,14 +13,20 @@
+
+ Login with lightning ⚡ +
+
- {!! $this->qrCode !!} + + qrcode +
-
+
+ + {{ __('Click to connect') }} + +
+
+ {{ __('Copy') }} @@ -52,7 +72,7 @@ @endif
- {{ __('Copy the LNURL and paste it under "Send" or scan the QR code with "Send". LNURL-auth enabled wallets:') }} + {{ __('Scan this code or copy + paste it to your lightning wallet. Or click to login with your browser\'s wallet.') }}