DutchCodingCompany / filament-socialite

Add OAuth login through Laravel Socialite to Filament.
MIT License
141 stars 36 forks source link

Incorrect Routing for OAuth Buttons When Defining a Domain for Filament Panel #60

Closed mohaphez closed 6 months ago

mohaphez commented 6 months ago

When defining routes for a Filament panel using the following code snippet:

public function panel(Panel $panel): Panel
{
    return $panel
        ->domain('sample.test')
        ->default()
        ->plugins([
                FilamentSocialitePlugin::make()
                    ->setProviders([
                        'zoho' => [
                            'label'    => 'Zoho',
                            'icon'     => 'fab-delicious',
                            'color'    => 'gray',
                            'outlined' => true,
                        ],
                    ])
                    ->setSlug('authenticate')
                    ->setRegistrationEnabled(false)
                    ->setUserModelClass(config('auth.providers.users.model'))
            ]);
}

The Filament-Socialite package encounters an issue where it incorrectly adds parentheses to the defined domain and generates URLs like http://(sample.test)/authenticate/oauth/zoho for the authentication buttons on the login page. Consequently, when users click these buttons, they are redirected to an undefined domain.