Merge pull request #1956 from papuruth/refactor-1942-Fix-PSR-Auth-Library
Fix PSR issues in Auth library #1937
This commit is contained in:
commit
52915e0656
4 changed files with 15 additions and 15 deletions
|
@ -248,7 +248,7 @@ class Auth
|
||||||
*/
|
*/
|
||||||
public static function isPrivilegedUser(array $roles): bool
|
public static function isPrivilegedUser(array $roles): bool
|
||||||
{
|
{
|
||||||
if(
|
if (
|
||||||
array_key_exists('role:'.self::USER_ROLE_OWNER, $roles) ||
|
array_key_exists('role:'.self::USER_ROLE_OWNER, $roles) ||
|
||||||
array_key_exists('role:'.self::USER_ROLE_DEVELOPER, $roles) ||
|
array_key_exists('role:'.self::USER_ROLE_DEVELOPER, $roles) ||
|
||||||
array_key_exists('role:'.self::USER_ROLE_ADMIN, $roles)
|
array_key_exists('role:'.self::USER_ROLE_ADMIN, $roles)
|
||||||
|
@ -268,7 +268,7 @@ class Auth
|
||||||
*/
|
*/
|
||||||
public static function isAppUser(array $roles): bool
|
public static function isAppUser(array $roles): bool
|
||||||
{
|
{
|
||||||
if(array_key_exists('role:'.self::USER_ROLE_APP, $roles)) {
|
if (array_key_exists('role:'.self::USER_ROLE_APP, $roles)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,6 @@ namespace Appwrite\Auth\OAuth2;
|
||||||
|
|
||||||
use Appwrite\Auth\OAuth2\Paypal;
|
use Appwrite\Auth\OAuth2\Paypal;
|
||||||
|
|
||||||
|
|
||||||
class PaypalSandbox extends Paypal
|
class PaypalSandbox extends Paypal
|
||||||
{
|
{
|
||||||
protected $environment = 'sandbox';
|
protected $environment = 'sandbox';
|
||||||
|
|
|
@ -139,7 +139,8 @@ class Twitch extends OAuth2
|
||||||
if (empty($this->user)) {
|
if (empty($this->user)) {
|
||||||
$response = \json_decode($this->request(
|
$response = \json_decode($this->request(
|
||||||
'GET',
|
'GET',
|
||||||
$this->resourceEndpoint , [
|
$this->resourceEndpoint,
|
||||||
|
[
|
||||||
'Authorization: Bearer '.\urlencode($accessToken),
|
'Authorization: Bearer '.\urlencode($accessToken),
|
||||||
'Client-Id: '. \urlencode($this->appID)
|
'Client-Id: '. \urlencode($this->appID)
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue