mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-01-09 05:23:53 +05:30
Anal space fixes
This commit is contained in:
parent
0999bf4de3
commit
f78e05cb08
@ -11,22 +11,22 @@ class Client implements ClientInterface {
|
|||||||
{
|
{
|
||||||
if ( ! is_null($redirectUri) && is_null($clientSecret)) {
|
if ( ! is_null($redirectUri) && is_null($clientSecret)) {
|
||||||
$result = DB::table('oauth_clients')
|
$result = DB::table('oauth_clients')
|
||||||
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
||||||
->where('oauth_clients.id', $clientId)
|
->where('oauth_clients.id', $clientId)
|
||||||
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
||||||
->first();
|
->first();
|
||||||
} elseif ( ! is_null($clientSecret) && is_null($redirectUri)) {
|
} elseif ( ! is_null($clientSecret) && is_null($redirectUri)) {
|
||||||
$result = DB::table('oauth_clients')
|
$result = DB::table('oauth_clients')
|
||||||
->where('id', $clientId)
|
->where('id', $clientId)
|
||||||
->where('secret', $clientSecret)
|
->where('secret', $clientSecret)
|
||||||
->first();
|
->first();
|
||||||
} elseif ( ! is_null($clientSecret) && ! is_null($redirectUri)) {
|
} elseif ( ! is_null($clientSecret) && ! is_null($redirectUri)) {
|
||||||
$result = DB::table('oauth_clients')
|
$result = DB::table('oauth_clients')
|
||||||
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
||||||
->where('oauth_clients.id', $clientId)
|
->where('oauth_clients.id', $clientId)
|
||||||
->where('oauth_clients.secret', $clientSecret)
|
->where('oauth_clients.secret', $clientSecret)
|
||||||
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
||||||
->first();
|
->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (is_null($result)) {
|
if (is_null($result)) {
|
||||||
|
@ -8,21 +8,20 @@ use \League\OAuth2\Server\Storage\ScopeInterface;
|
|||||||
class Scope implements ScopeInterface {
|
class Scope implements ScopeInterface {
|
||||||
|
|
||||||
public function getScope($scope, $clientId = null, $grantType = null)
|
public function getScope($scope, $clientId = null, $grantType = null)
|
||||||
{
|
{
|
||||||
$result = DB::table('oauth_scopes')
|
$result = DB::table('oauth_scopes')
|
||||||
->where('key', $scope)
|
->where('key', $scope)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if (is_null($result)) {
|
if (is_null($result)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'id' => $result->id,
|
'id' => $result->id,
|
||||||
'scope' => $result->key,
|
'scope' => $result->key,
|
||||||
'name' => $result->name,
|
'name' => $result->name,
|
||||||
'description' => $result->description
|
'description' => $result->description
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user