Closed bansalvinay closed 4 years ago
You can send anything in payload , and can retrieve in resolveUserByProviderCredentials()
method.
<?php
namespace App\Resolvers;
use Coderello\SocialGrant\Resolvers\SocialUserResolverInterface;
use Illuminate\Contracts\Auth\Authenticatable;
use Laravel\Socialite\Facades\Socialite;
class SocialUserResolver implements SocialUserResolverInterface
{
/**
* Resolve user by provider credentials.
*
* @param string $provider
* @param string $accessToken
*
* @return Authenticatable|null
*/
public function resolveUserByProviderCredentials(string $provider, string $accessToken): ?Authenticatable
{
$requestType = request("method");
// Take decision based on user input
}
}
Is it possible to specify the authentication type?
If we want to differentiate if the request is for login or registration?
Something like this :
This way, we can reject users trying to login without registering. They may be having multiple google accounts, and by mistake select wrong account.