-
-
Notifications
You must be signed in to change notification settings - Fork 268
Passkeys #2192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Passkeys #2192
Changes from all commits
52d2ffb
e60784b
d051f4c
13961c8
02e5644
3aaba31
64799cd
816ad1f
d87aa2d
6906381
e51f3c7
c57a54f
378c4dd
a045eaf
33792a1
a2704f7
e16a3d8
0c47ec2
5029e57
80dbcfc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| <?php | ||
|
|
||
| namespace App\Livewire; | ||
|
|
||
| use Filament\Actions\Action; | ||
| use Filament\Actions\Concerns\InteractsWithActions; | ||
| use Filament\Actions\Contracts\HasActions; | ||
| use Filament\Notifications\Notification; | ||
| use Filament\Schemas\Concerns\InteractsWithSchemas; | ||
| use Filament\Schemas\Contracts\HasSchemas; | ||
| use Illuminate\View\View; | ||
| use Spatie\LaravelPasskeys\Livewire\PasskeysComponent; | ||
|
|
||
| final class Passkeys extends PasskeysComponent implements HasActions, HasSchemas | ||
| { | ||
| use InteractsWithActions; | ||
| use InteractsWithSchemas; | ||
|
|
||
| public function confirmDelete(int $passkeyId): void | ||
| { | ||
| $this->mountAction('deleteAction', ['passkey' => $passkeyId]); | ||
| } | ||
|
|
||
| public function deleteAction(): Action | ||
| { | ||
| return Action::make('deleteAction') | ||
| ->label(trans('passkeys.delete')) | ||
| ->color('danger') | ||
| ->requiresConfirmation() | ||
| ->action(fn (array $arguments) => $this->deletePasskey((int) $arguments['passkey'])); | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public function deletePasskey(int $passkeyId): void | ||
| { | ||
| $this->currentUser()->passkeys()->findOrFail($passkeyId); | ||
|
|
||
| parent::deletePasskey($passkeyId); | ||
|
|
||
| Notification::make() | ||
| ->title(trans('passkeys.deleted_notification_title')) | ||
| ->success() | ||
| ->send(); | ||
| } | ||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public function storePasskey(string $passkey): void | ||
| { | ||
| parent::storePasskey($passkey); | ||
|
|
||
| Notification::make() | ||
| ->title(trans('passkeys.created_notification_title')) | ||
| ->success() | ||
| ->send(); | ||
| } | ||
|
|
||
| public function render(): View | ||
| { | ||
| return view('passkeys.livewire.passkeys', data: [ | ||
| 'passkeys' => $this->currentUser()->passkeys()->get(), | ||
| ]); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,7 +15,7 @@ | |||||
| "filament/filament": "^4.5", | ||||||
| "gboquizosanchez/filament-log-viewer": "^2.1", | ||||||
| "guzzlehttp/guzzle": "^7.10", | ||||||
| "laravel/framework": "^12.49", | ||||||
| "laravel/framework": "~12.49.0", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, let's check the actual composer.json file to confirm the constraint
cat composer.json | head -50Repository: pelican-dev/panel Length of output: 1973 🌐 Web query:
💡 Result:
Docs note (Spatie): the package “requires PHP 8.4+, Laravel 12+.” [2] Practical requirement: it includes a Livewire component, so you should have Livewire installed. [3] Sources: [1] (packagist.org) [2] (spatie.be) [3] (github.com) Citations:
Unnecessarily restrictive Laravel version constraint. Changing from
Proposed fix: revert to the original caret constraint- "laravel/framework": "~12.49.0",
+ "laravel/framework": "^12.49",📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||
| "laravel/helpers": "^1.8", | ||||||
| "laravel/sanctum": "^4.2", | ||||||
| "laravel/socialite": "^5.24", | ||||||
|
|
@@ -35,6 +35,7 @@ | |||||
| "spatie/laravel-data": "^4.19", | ||||||
| "spatie/laravel-fractal": "^6.3", | ||||||
| "spatie/laravel-health": "^1.34", | ||||||
| "spatie/laravel-passkeys": "^1.5", | ||||||
| "spatie/laravel-permission": "^6.24", | ||||||
| "spatie/laravel-query-builder": "^6.4", | ||||||
| "spatie/temporary-directory": "^2.3", | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use the
formfunction that's already there. And remove all the extra views.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I was checking this, and I don't seem to find a way to make it how you want, as the view is required for the button to appear.
I would like it if you could give me some kind of direction so I can fix it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You extract the components that are used in the views and add them to the
forminstead, e.g. withAction::makeorTextInput::makeor whatever is needed.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was checking this, and I don't seem to know how, as each method will always return me to the same point. JS won't call passkeys or if it does, it won't log in.
MarcelWeldium passkeys worked this way, and it requires the views for the actions to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll still try to find a way, but I'm not sure about it...