Make user id attribute for social network authentification configurable
This commit is contained in:
@ -14,8 +14,9 @@ namespace Da\User\Contracts;
|
|||||||
use yii\authclient\ClientInterface;
|
use yii\authclient\ClientInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property-read string $email
|
* @property-read string|null $email
|
||||||
* @property-read string $username
|
* @property-read string|null $userName
|
||||||
|
* @property-read mixed|null $userId
|
||||||
*/
|
*/
|
||||||
interface AuthClientInterface extends ClientInterface
|
interface AuthClientInterface extends ClientInterface
|
||||||
{
|
{
|
||||||
@ -28,4 +29,9 @@ interface AuthClientInterface extends ClientInterface
|
|||||||
* @return string|null username
|
* @return string|null username
|
||||||
*/
|
*/
|
||||||
public function getUserName();
|
public function getUserName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return mixed|null user id
|
||||||
|
*/
|
||||||
|
public function getUserId();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -83,7 +83,7 @@ class SocialNetworkAccountConnectService implements ServiceInterface
|
|||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
'provider' => $this->client->getId(),
|
'provider' => $this->client->getId(),
|
||||||
'client_id' => $data['id'],
|
'client_id' => $this->client->getUserId(),
|
||||||
'data' => json_encode($data),
|
'data' => json_encode($data),
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|||||||
@ -97,7 +97,7 @@ class SocialNetworkAuthenticateService implements ServiceInterface
|
|||||||
[],
|
[],
|
||||||
[
|
[
|
||||||
'provider' => $this->client->getId(),
|
'provider' => $this->client->getId(),
|
||||||
'client_id' => $data['id'],
|
'client_id' => $this->client->getUserId(),
|
||||||
'data' => json_encode($data),
|
'data' => json_encode($data),
|
||||||
'username' => $this->client->getUserName(),
|
'username' => $this->client->getUserName(),
|
||||||
'email' => $this->client->getEmail(),
|
'email' => $this->client->getEmail(),
|
||||||
|
|||||||
Reference in New Issue
Block a user