chrisreedio / socialment

Socialite OAuth Support for Filament
MIT License
73 stars 10 forks source link

adding redirect hooks #40

Closed rupadana closed 2 months ago

rupadana commented 5 months ago

this hooks used to modify socialite scope or other before redirected

public function boot(): void
{
    Socialment::redirect(function(AbstractProvider $provider) {
        return $provider->setScopes([
            'repo','read:user'
        ]);
    });
}
chrisreedio commented 5 months ago

@rupadana Can you explain why this is needed?

I'm not seeing a big use case personally.

chrisreedio commented 5 months ago

Bringing over some notes from Discord:

->plugins([
    \ChrisReedIO\Socialment\SocialmentPlugin::make()
        ->registerProvider('azure', 'fab-windows', 'Azure'),
        ->registerProvider('github', 'fab-github', 'Github', scopes: ['repo', 'read:user']),
])

Something like this would allow for differing scopes per provider, per panel.

Need some additional thoughts for multi-tenancy.

rupadana commented 5 months ago

@chrisreedio please review it again

chrisreedio commented 2 months ago

This has been implemented by #58