mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 05:29:52 +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)) {
|
||||
$result = DB::table('oauth_clients')
|
||||
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
||||
->where('oauth_clients.id', $clientId)
|
||||
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
||||
->first();
|
||||
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
||||
->where('oauth_clients.id', $clientId)
|
||||
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
||||
->first();
|
||||
} elseif ( ! is_null($clientSecret) && is_null($redirectUri)) {
|
||||
$result = DB::table('oauth_clients')
|
||||
->where('id', $clientId)
|
||||
->where('secret', $clientSecret)
|
||||
->first();
|
||||
->where('id', $clientId)
|
||||
->where('secret', $clientSecret)
|
||||
->first();
|
||||
} elseif ( ! is_null($clientSecret) && ! is_null($redirectUri)) {
|
||||
$result = DB::table('oauth_clients')
|
||||
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
||||
->where('oauth_clients.id', $clientId)
|
||||
->where('oauth_clients.secret', $clientSecret)
|
||||
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
||||
->first();
|
||||
->join('oauth_client_endpoints', 'oauth_clients.id', '=', 'oauth_client_endpoints.client_id')
|
||||
->where('oauth_clients.id', $clientId)
|
||||
->where('oauth_clients.secret', $clientSecret)
|
||||
->where('oauth_client_endpoints.redirect_uri', $redirectUri)
|
||||
->first();
|
||||
}
|
||||
|
||||
if (is_null($result)) {
|
||||
|
@ -8,21 +8,20 @@ use \League\OAuth2\Server\Storage\ScopeInterface;
|
||||
class Scope implements ScopeInterface {
|
||||
|
||||
public function getScope($scope, $clientId = null, $grantType = null)
|
||||
{
|
||||
$result = DB::table('oauth_scopes')
|
||||
->where('key', $scope)
|
||||
->first();
|
||||
{
|
||||
$result = DB::table('oauth_scopes')
|
||||
->where('key', $scope)
|
||||
->first();
|
||||
|
||||
if (is_null($result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return array(
|
||||
'id' => $result->id,
|
||||
'scope' => $result->key,
|
||||
'name' => $result->name,
|
||||
'description' => $result->description
|
||||
'id' => $result->id,
|
||||
'scope' => $result->key,
|
||||
'name' => $result->name,
|
||||
'description' => $result->description
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user