1
0
Fork 0
mirror of synced 2024-09-30 09:18:14 +13:00

chore: Adapter fixes

This commit is contained in:
Christy Jacob 2020-01-18 10:15:54 +05:30
parent 1678021ce3
commit c63eb7fda5
2 changed files with 14 additions and 8 deletions

View file

@ -14,6 +14,11 @@ class Apple extends OAuth
*/
protected $user = [];
/**
* @var array
*/
protected $scopes = ["name", "email"];
/**
* @return string
*/
@ -27,13 +32,14 @@ class Apple extends OAuth
*/
public function getLoginURL(): string
{
return 'https://appleid.apple.com/auth/authorize?'.
'client_id='.urlencode($this->appID).
'&redirect_uri='.urlencode($this->callback).
'&state='.urlencode(json_encode($this->state)).
'&response_type=code'.
'&response_mode=form_post'.
'&scope=name+email';
return 'https://appleid.apple.com/auth/authorize?'.http_build_query([
'client_id' => urlencode($this->appID),
'redirect_uri' => urlencode($this->callback),
'state' => urlencode(json_encode($this->state)),
'response_type' => 'code',
'response_mode' => 'form_post',
'scope' => implode('+', $this->getScopes())
]);
}
/**

View file

@ -49,7 +49,7 @@ class LinkedIn extends OAuth
'response_type' => 'code',
'client_id' => $this->appID,
'redirect_uri' => $this->callback,
'scope' => implode(' ', $this->scope),
'scope' => implode(' ', $this->getScopes()),
'state' => json_encode($this->state),
]);
}