rawilk / profile-filament-plugin

Profile & MFA starter kit for filament.
https://randallwilk.dev/docs/profile-filament-plugin
MIT License
27 stars 7 forks source link

Route::macro webauthn issue #56

Open jouniikaheimo opened 1 month ago

jouniikaheimo commented 1 month ago

profile-filament-plugin Version

latest

Laravel Version

latest

Bug description

Latest version profile-filament-plugin not register Route::macro i use previous and all working fine i use also stancl laravel tenants and this working before fine but now Route [profile-filament::webauthn.assertion_pk] not defined.

Steps to reproduce

No response

Relevant log output

No response

rawilk commented 1 month ago

If you run php artisan route:list in your project, do the routes show up?

I have v0.5.0 in an app right now and the routes are showing up correctly for me.

jouniikaheimo commented 1 month ago

yes route show correct POST sessions/webauthn/assertion-pk/{user} ...................................................................................................................................... profile-filament::webauthn.assertion_pk › Rawilk\ProfileFilament\Http\Controllers\WebauthnPublicKeysController@assertionPublicKey POST sessions/webauthn/attestation-pk ....................................................................................................................................... profile-filament::webauthn.attestation_pk › Rawilk\ProfileFilament\Http\Controllers\WebauthnPublicKeysController@attestationPublicKey POST sessions/webauthn/passkey-assertion-pk ....................................................................................................................................... profile-filament::webauthn.passkey_assertion_pk › Rawilk\ProfileFilament\Http\Controllers\PasskeysController@assertionPublicKey POST sessions/webauthn/passkey-attestation-pk ................................................................................................................................. profile-filament::webauthn.passkey_attestation_pk › Rawilk\ProfileFilament\Http\Controllers\PasskeysController@attestationPublicKey

I sometimes have the same problem but never found out what fixed it

but i'm try to debug this route in component file dd(route(profile-filament::webauthn.assertion_pk)) route not found

rawilk commented 1 month ago

I haven't ever used the multi-tenancy package you're using, but it's possible it could be causing issues with these routes. However, if the routes are showing up when you list all routes, I'm not really sure what the issue would be.

Without knowing much else about your project, it's hard to say for sure what the issue is. For my project, I added the webauthn routes at the very end of my routes/web.php file.

jouniikaheimo commented 1 month ago

little more debug if help

  protected function webauthnOptionsUrl(): string
    {

        $routes = Route::getRoutes();

        dd($routes);

        return URL::temporarySignedRoute(
            name: 'profile-filament::webauthn.assertion_pk',
            expiration: now()->addHour(),
            parameters: [
                'user' => $this->user->getRouteKey(),
                's' => MfaSession::AssertionPublicKey->value,
            ],
        );
    }

all routes:

"GET|HEADtimeline" => Illuminate\Routing\Route {#2762 …18}
"POSTsessions/webauthn/assertion-pk/{user}" => Illuminate\Routing\Route {#2768 …18}
"POSTsessions/webauthn/passkey-assertion-pk" => Illuminate\Routing\Route {#2769 …18}
"POSTsessions/webauthn/attestation-pk" => Illuminate\Routing\Route {#2770 …18}
"POSTsessions/webauthn/passkey-attestation-pk" => Illuminate\Routing\Route {#2771 …18}

but issue found possible next

nameList: array:115 [▼

  "filament.admin.pending_email.revert" => Illuminate\Routing\Route {#2723 …18}
"filament.tenant.auth.mfa.challenge" => Illuminate\Routing\Route {#2724 …18}
"filament.tenant.auth.mfa.recovery-codes.print" => Illuminate\Routing\Route {#2725 …18}
"filament.tenant.auth.sudo-challenge" => Illuminate\Routing\Route {#2726 …18}
"filament.tenant.pending_email.verify" => Illuminate\Routing\Route {#2727 …18}
"filament.tenant.pending_email.revert" => Illuminate\Routing\Route {#2728 …18}
**"profile-filament::" => Illuminate\Routing\Route {#2771 …18}**