From 31b8798656c8839f2eb6ed717e0965a13e5a0050 Mon Sep 17 00:00:00 2001 From: Will Browning Date: Tue, 29 Jul 2025 14:59:24 +0100 Subject: [PATCH] Updated to Laravel 12 --- app/Actions/RegisterKeyStore.php | 41 -------------------------- app/Facades/Webauthn.php | 4 +-- composer.json | 6 ++-- config/webauthn.php | 31 +++++++++++++++++++ resources/js/Layouts/AppLayout.vue | 4 +-- resources/js/Pages/Aliases/Index.vue | 33 +++++++++++---------- resources/js/Pages/Domains/Index.vue | 5 ++-- resources/js/Pages/Settings/Api.vue | 5 ++-- resources/js/Pages/Usernames/Index.vue | 6 ++-- 9 files changed, 64 insertions(+), 71 deletions(-) delete mode 100644 app/Actions/RegisterKeyStore.php diff --git a/app/Actions/RegisterKeyStore.php b/app/Actions/RegisterKeyStore.php deleted file mode 100644 index 30aeb97..0000000 --- a/app/Actions/RegisterKeyStore.php +++ /dev/null @@ -1,41 +0,0 @@ -throwFailedRegisterException($user); - } - - try { - $publicKeyCredentialSource = $this->app[CredentialAttestationValidator::class]($publicKey, $data); - - $webauthnKey = Webauthn::create($user, $keyName, $publicKeyCredentialSource); - - WebauthnRegister::dispatch($webauthnKey); - - Webauthn::login(); - - return $webauthnKey; - } catch (Exception $e) { - $this->throwFailedRegisterException($user, $e); - } - - return null; - } -} diff --git a/app/Facades/Webauthn.php b/app/Facades/Webauthn.php index e2187da..a730384 100644 --- a/app/Facades/Webauthn.php +++ b/app/Facades/Webauthn.php @@ -3,8 +3,8 @@ namespace App\Facades; use Illuminate\Support\Facades\Facade; -use Webauthn\PublicKeyCredentialCreationOptions; -use Webauthn\PublicKeyCredentialRequestOptions; +use LaravelWebauthn\Services\Webauthn\PublicKeyCredentialCreationOptions; +use LaravelWebauthn\Services\Webauthn\PublicKeyCredentialRequestOptions; /** * @method static PublicKeyCredentialCreationOptions getRegisterData(\Illuminate\Contracts\Auth\Authenticatable $user) diff --git a/composer.json b/composer.json index 633dd0e..4648674 100644 --- a/composer.json +++ b/composer.json @@ -8,17 +8,17 @@ "license": "AGPL-3.0-or-later", "require": { "php": "^8.2", - "asbiin/laravel-webauthn": "^4.0.0", + "asbiin/laravel-webauthn": "5.0.1", "bacon/bacon-qr-code": "^3.0", "chillerlan/php-qrcode": "^5.0", "guzzlehttp/guzzle": "^7.2", "inertiajs/inertia-laravel": "^2.0", - "laravel/framework": "^11.0", + "laravel/framework": "^12.0", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.7", "laravel/ui": "^4.0", "maatwebsite/excel": "^3.1", - "mews/captcha": "3.3.3", + "mews/captcha": "^3.3.3", "php-mime-mail-parser/php-mime-mail-parser": "^9.0", "pragmarx/google2fa-laravel": "^2.0.0", "ramsey/uuid": "^4.0", diff --git a/config/webauthn.php b/config/webauthn.php index 9691389..a3aab52 100644 --- a/config/webauthn.php +++ b/config/webauthn.php @@ -131,6 +131,20 @@ return [ 'register' => 'vendor.webauthn.register', ], + /* + |-------------------------------------------------------------------------- + | Webauthn logging + |-------------------------------------------------------------------------- + | + | Here you may specify the channel to which Webauthn will log messages. + | This value should correspond with one of your loggers that is already + | present in your "logging" configuration file. If left as null, it will + | use the default logger for the application. + | + */ + + 'log' => 'null', + /* |-------------------------------------------------------------------------- | Session name @@ -266,6 +280,23 @@ return [ 'user_verification' => 'discouraged', + /* + |-------------------------------------------------------------------------- + | The resident key + |-------------------------------------------------------------------------- + | + | When userless is set to 'preferred' or 'required', the resident key will be + | forced to be 'required' automatically. + | + | See https://www.w3.org/TR/webauthn/#enum-residentKeyRequirement + | + | Supported: "null", "required", "preferred", "discouraged". + | Forced to "required" when userless is true. + | + */ + + 'resident_key' => null, + /* |-------------------------------------------------------------------------- | Userless (One touch, Typeless) login diff --git a/resources/js/Layouts/AppLayout.vue b/resources/js/Layouts/AppLayout.vue index af636b2..e6e116b 100644 --- a/resources/js/Layouts/AppLayout.vue +++ b/resources/js/Layouts/AppLayout.vue @@ -217,13 +217,13 @@
diff --git a/resources/js/Pages/Aliases/Index.vue b/resources/js/Pages/Aliases/Index.vue index b84751e..087eb40 100644 --- a/resources/js/Pages/Aliases/Index.vue +++ b/resources/js/Pages/Aliases/Index.vue @@ -385,8 +385,8 @@ @@ -695,10 +695,10 @@ It doesn't look like you have any aliases yet!
-

There {{ domain ? 'are two ways' : 'is one way'}} to create new aliases.

-

- Create aliases on the fly -

+

+ There {{ domain ? 'are two ways' : 'is one way' }} to create new aliases. +

+

Create aliases on the fly

To create aliases on the fly all you have to do is make up any new alias and give that out instead of your real email address. @@ -720,19 +720,20 @@

-

There is one way to create new aliases.

-

- Create a unique random alias -

+

+ There is one way to create new aliases. +

+

Create a unique random alias

- You can click the button above to create a random alias that will look something like this: + You can click the button above to create a random alias that will look something like + this:

x481n904@{{ domain }}

- This is useful if you do not wish to include your username in the email as a potential link - between aliases. + This is useful if you do not wish to include your username in the email as a potential + link between aliases.

@@ -1312,8 +1313,8 @@

Shared Domain Aliases - A shared domain alias is any alias that has a domain name - that is also shared with other users. Aliases with shared domain names must be pre-generated and cannot be - created on-the-fly like standard aliases. + that is also shared with other users. Aliases with shared domain names must be + pre-generated and cannot be created on-the-fly like standard aliases.

diff --git a/resources/js/Pages/Domains/Index.vue b/resources/js/Pages/Domains/Index.vue index 2cb6627..b6dc615 100644 --- a/resources/js/Pages/Domains/Index.vue +++ b/resources/js/Pages/Domains/Index.vue @@ -105,14 +105,15 @@ }}
-
diff --git a/resources/js/Pages/Settings/Api.vue b/resources/js/Pages/Settings/Api.vue index f42e980..317778b 100644 --- a/resources/js/Pages/Settings/Api.vue +++ b/resources/js/Pages/Settings/Api.vue @@ -190,8 +190,9 @@

- This is your new personal access key. This is the only time the key will ever be - displayed, so please make a note of it in a safe place (e.g. password manager)! + This is your new personal access key. + This is the only time the key will ever be displayed, so please make a note of it + in a safe place (e.g. password manager)!