spatie / laravel-multitenancy

Make your Laravel app usable by multiple tenants
https://spatie.be/docs/laravel-multitenancy
MIT License
1.08k stars 154 forks source link

Tenant password reset token is being stored on landlord password_reset_tokens table #483

Closed pratikkuikel closed 1 year ago

pratikkuikel commented 1 year ago

I am using filamentphp v3 with AdminPanel and TenantPanel, At the end of configuring and testing password resets I noticed that : for the password reset tokens the password reset requested from tenant panel is being stored to landlord database, while the reset works just fine. I wonder what is causing this behavior ! , Everything works fine despite the tenant password resets being stored on landlord's table. The password reset mail just works with the tenant subdomain and the password reset is successful but I find this behavior weird. I need some guidance.

I am using different password brokers for landlord and tenant :

 'providers' => [
        'landlords' => [
            'driver' => 'eloquent',
            'model' => App\Models\Landlord\User::class,
        ],

        'tenants' => [
            'driver' => 'eloquent',
            'model' => App\Models\Tenant\User::class,
        ],
    ], 
'passwords' => [
        'landlords' => [
            'provider' => 'landlords',
            'table' => 'password_reset_tokens',
            'expire' => 60,
            'throttle' => 60,
        ],
        'tenants' => [
            'provider' => 'tenants',
            'table' => 'password_reset_tokens',
            'expire' => 60,
            'throttle' => 60,
        ],
    ],

landlord password resets works too. Everything is working as expected.

masterix21 commented 1 year ago

Duplicate of https://github.com/spatie/laravel-multitenancy/discussions/482