Scope social login callbacks per flow
This commit is contained in:
@@ -26,6 +26,7 @@ class TenantAdminFacebookControllerTest extends TestCase
|
||||
{
|
||||
$driver = Mockery::mock();
|
||||
Socialite::shouldReceive('driver')->once()->with('facebook')->andReturn($driver);
|
||||
$driver->shouldReceive('redirectUrl')->once()->with(route('tenant.admin.facebook.callback'))->andReturnSelf();
|
||||
$driver->shouldReceive('scopes')->once()->with(['email'])->andReturnSelf();
|
||||
$driver->shouldReceive('fields')->once()->with(['name', 'email', 'first_name', 'last_name'])->andReturnSelf();
|
||||
$driver->shouldReceive('redirect')->once()->andReturn(new RedirectResponse('https://facebook.com/auth'));
|
||||
|
||||
@@ -26,6 +26,7 @@ class TenantAdminGoogleControllerTest extends TestCase
|
||||
{
|
||||
$driver = Mockery::mock();
|
||||
Socialite::shouldReceive('driver')->once()->with('google')->andReturn($driver);
|
||||
$driver->shouldReceive('redirectUrl')->once()->with(route('tenant.admin.google.callback'))->andReturnSelf();
|
||||
$driver->shouldReceive('scopes')->once()->with(['openid', 'profile', 'email'])->andReturnSelf();
|
||||
$driver->shouldReceive('with')->once()->with(['prompt' => 'select_account'])->andReturnSelf();
|
||||
$driver->shouldReceive('redirect')->once()->andReturn(new RedirectResponse('https://accounts.google.com'));
|
||||
|
||||
@@ -27,6 +27,7 @@ class CheckoutFacebookControllerTest extends TestCase
|
||||
$package = Package::factory()->create();
|
||||
|
||||
$provider = Mockery::mock(SocialiteProvider::class);
|
||||
$provider->shouldReceive('redirectUrl')->with(route('checkout.facebook.callback'))->andReturnSelf();
|
||||
$provider->shouldReceive('scopes')->andReturnSelf();
|
||||
$provider->shouldReceive('fields')->andReturnSelf();
|
||||
$provider->shouldReceive('redirect')->once()->andReturn(redirect('/facebook/auth'));
|
||||
|
||||
@@ -27,6 +27,7 @@ class CheckoutGoogleControllerTest extends TestCase
|
||||
$package = Package::factory()->create();
|
||||
|
||||
$provider = Mockery::mock(SocialiteProvider::class);
|
||||
$provider->shouldReceive('redirectUrl')->with(route('checkout.google.callback'))->andReturnSelf();
|
||||
$provider->shouldReceive('scopes')->andReturnSelf();
|
||||
$provider->shouldReceive('with')->andReturnSelf();
|
||||
$provider->shouldReceive('redirect')->once()->andReturn(redirect('/google/auth'));
|
||||
|
||||
Reference in New Issue
Block a user