@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class AssignRelationsSeeder extends Seeder |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the database seeds. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function run() |
|
| 15 | - { |
|
| 16 | - $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id; |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Assign the permissions to the admin role. |
|
| 20 | - */ |
|
| 21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['permission'])->each(function ($permission) use ($adminRoleId) { |
|
| 22 | - \DB::table('permission_role')->insert( |
|
| 23 | - [ |
|
| 24 | - 'permission_id' => $permission->id, |
|
| 25 | - 'role_id' => $adminRoleId, |
|
| 26 | - 'created_at' => \DB::raw('NOW()'), |
|
| 27 | - 'updated_at' => \DB::raw('NOW()') |
|
| 28 | - ] |
|
| 29 | - ); |
|
| 30 | - }); |
|
| 31 | - } |
|
| 18 | + /** |
|
| 19 | + * Assign the permissions to the admin role. |
|
| 20 | + */ |
|
| 21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['permission'])->each(function ($permission) use ($adminRoleId) { |
|
| 22 | + \DB::table('permission_role')->insert( |
|
| 23 | + [ |
|
| 24 | + 'permission_id' => $permission->id, |
|
| 25 | + 'role_id' => $adminRoleId, |
|
| 26 | + 'created_at' => \DB::raw('NOW()'), |
|
| 27 | + 'updated_at' => \DB::raw('NOW()') |
|
| 28 | + ] |
|
| 29 | + ); |
|
| 30 | + }); |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Assign the permissions to the admin role. |
| 20 | 20 | */ |
| 21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['permission'])->each(function ($permission) use ($adminRoleId) { |
|
| 21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['permission'])->each(function($permission) use ($adminRoleId) { |
|
| 22 | 22 | \DB::table('permission_role')->insert( |
| 23 | 23 | [ |
| 24 | 24 | 'permission_id' => $permission->id, |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ClearDataSeeder extends Seeder |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the database seeds. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function run() |
|
| 15 | - { |
|
| 16 | - $permissions = \DB::table('permissions')->whereIn('model', ['permission']); |
|
| 17 | - \DB::table('permission_role')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
| 18 | - $permissions->delete(); |
|
| 19 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + $permissions = \DB::table('permissions')->whereIn('model', ['permission']); |
|
| 17 | + \DB::table('permission_role')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
| 18 | + $permissions->delete(); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -5,41 +5,41 @@ |
||
| 5 | 5 | |
| 6 | 6 | class Permissions extends Migration |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Run the migrations. |
|
| 10 | - * |
|
| 11 | - * @return void |
|
| 12 | - */ |
|
| 13 | - public function up() |
|
| 14 | - { |
|
| 15 | - Schema::create('permissions', function (Blueprint $table) { |
|
| 16 | - $table->increments('id'); |
|
| 17 | - $table->string('name', 100); |
|
| 18 | - $table->string('model', 100); |
|
| 19 | - $table->softDeletes(); |
|
| 20 | - $table->timestamps(); |
|
| 21 | - $table->unique(array('name', 'model')); |
|
| 22 | - }); |
|
| 23 | - Schema::create('permission_role', function (Blueprint $table) { |
|
| 24 | - $table->increments('id'); |
|
| 25 | - $table->unsignedInteger('role_id'); |
|
| 26 | - $table->unsignedInteger('permission_id'); |
|
| 27 | - $table->softDeletes(); |
|
| 28 | - $table->timestamps(); |
|
| 8 | + /** |
|
| 9 | + * Run the migrations. |
|
| 10 | + * |
|
| 11 | + * @return void |
|
| 12 | + */ |
|
| 13 | + public function up() |
|
| 14 | + { |
|
| 15 | + Schema::create('permissions', function (Blueprint $table) { |
|
| 16 | + $table->increments('id'); |
|
| 17 | + $table->string('name', 100); |
|
| 18 | + $table->string('model', 100); |
|
| 19 | + $table->softDeletes(); |
|
| 20 | + $table->timestamps(); |
|
| 21 | + $table->unique(array('name', 'model')); |
|
| 22 | + }); |
|
| 23 | + Schema::create('permission_role', function (Blueprint $table) { |
|
| 24 | + $table->increments('id'); |
|
| 25 | + $table->unsignedInteger('role_id'); |
|
| 26 | + $table->unsignedInteger('permission_id'); |
|
| 27 | + $table->softDeletes(); |
|
| 28 | + $table->timestamps(); |
|
| 29 | 29 | |
| 30 | - $table->foreign('role_id')->references('id')->on('roles'); |
|
| 31 | - $table->foreign('permission_id')->references('id')->on('permissions'); |
|
| 32 | - }); |
|
| 33 | - } |
|
| 30 | + $table->foreign('role_id')->references('id')->on('roles'); |
|
| 31 | + $table->foreign('permission_id')->references('id')->on('permissions'); |
|
| 32 | + }); |
|
| 33 | + } |
|
| 34 | 34 | |
| 35 | - /** |
|
| 36 | - * Reverse the migrations. |
|
| 37 | - * |
|
| 38 | - * @return void |
|
| 39 | - */ |
|
| 40 | - public function down() |
|
| 41 | - { |
|
| 42 | - Schema::dropIfExists('permissions'); |
|
| 43 | - Schema::dropIfExists('permission_role'); |
|
| 44 | - } |
|
| 35 | + /** |
|
| 36 | + * Reverse the migrations. |
|
| 37 | + * |
|
| 38 | + * @return void |
|
| 39 | + */ |
|
| 40 | + public function down() |
|
| 41 | + { |
|
| 42 | + Schema::dropIfExists('permissions'); |
|
| 43 | + Schema::dropIfExists('permission_role'); |
|
| 44 | + } |
|
| 45 | 45 | } |
@@ -12,7 +12,7 @@ discard block |
||
| 12 | 12 | */ |
| 13 | 13 | public function up() |
| 14 | 14 | { |
| 15 | - Schema::create('permissions', function (Blueprint $table) { |
|
| 15 | + Schema::create('permissions', function(Blueprint $table) { |
|
| 16 | 16 | $table->increments('id'); |
| 17 | 17 | $table->string('name', 100); |
| 18 | 18 | $table->string('model', 100); |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | $table->timestamps(); |
| 21 | 21 | $table->unique(array('name', 'model')); |
| 22 | 22 | }); |
| 23 | - Schema::create('permission_role', function (Blueprint $table) { |
|
| 23 | + Schema::create('permission_role', function(Blueprint $table) { |
|
| 24 | 24 | $table->increments('id'); |
| 25 | 25 | $table->unsignedInteger('role_id'); |
| 26 | 26 | $table->unsignedInteger('permission_id'); |
@@ -7,21 +7,21 @@ |
||
| 7 | 7 | |
| 8 | 8 | class PermissionController extends BaseApiController |
| 9 | 9 | { |
| 10 | - /** |
|
| 11 | - * Path of the model resource |
|
| 12 | - * |
|
| 13 | - * @var string |
|
| 14 | - */ |
|
| 15 | - protected $modelResource = 'App\Modules\Permissions\Http\Resources\Permission'; |
|
| 10 | + /** |
|
| 11 | + * Path of the model resource |
|
| 12 | + * |
|
| 13 | + * @var string |
|
| 14 | + */ |
|
| 15 | + protected $modelResource = 'App\Modules\Permissions\Http\Resources\Permission'; |
|
| 16 | 16 | |
| 17 | - /** |
|
| 18 | - * Init new object. |
|
| 19 | - * |
|
| 20 | - * @param PermissionService $service |
|
| 21 | - * @return void |
|
| 22 | - */ |
|
| 23 | - public function __construct(PermissionService $service) |
|
| 24 | - { |
|
| 25 | - parent::__construct($service); |
|
| 26 | - } |
|
| 17 | + /** |
|
| 18 | + * Init new object. |
|
| 19 | + * |
|
| 20 | + * @param PermissionService $service |
|
| 21 | + * @return void |
|
| 22 | + */ |
|
| 23 | + public function __construct(PermissionService $service) |
|
| 24 | + { |
|
| 25 | + parent::__construct($service); |
|
| 26 | + } |
|
| 27 | 27 | } |
@@ -5,14 +5,14 @@ |
||
| 5 | 5 | |
| 6 | 6 | class PermissionService extends BaseService |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Init new object. |
|
| 10 | - * |
|
| 11 | - * @param PermissionRepository $repo |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function __construct(PermissionRepository $repo) |
|
| 15 | - { |
|
| 16 | - parent::__construct($repo); |
|
| 17 | - } |
|
| 8 | + /** |
|
| 9 | + * Init new object. |
|
| 10 | + * |
|
| 11 | + * @param PermissionRepository $repo |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function __construct(PermissionRepository $repo) |
|
| 15 | + { |
|
| 16 | + parent::__construct($repo); |
|
| 17 | + } |
|
| 18 | 18 | } |
@@ -5,64 +5,64 @@ |
||
| 5 | 5 | |
| 6 | 6 | class OauthClientRepository extends BaseRepository |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Init new object. |
|
| 10 | - * |
|
| 11 | - * @param OauthClient $model |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function __construct(OauthClient $model) |
|
| 15 | - { |
|
| 16 | - parent::__construct($model); |
|
| 17 | - } |
|
| 8 | + /** |
|
| 9 | + * Init new object. |
|
| 10 | + * |
|
| 11 | + * @param OauthClient $model |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function __construct(OauthClient $model) |
|
| 15 | + { |
|
| 16 | + parent::__construct($model); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Revoke the given client tokens. |
|
| 21 | - * |
|
| 22 | - * @param mixed $client |
|
| 23 | - * @return void |
|
| 24 | - */ |
|
| 25 | - public function revokeClientTokens($client) |
|
| 26 | - { |
|
| 27 | - $client = is_int($client) ? $client : $this->find($client); |
|
| 28 | - $client->tokens()->update(['revoked' => true]); |
|
| 29 | - } |
|
| 19 | + /** |
|
| 20 | + * Revoke the given client tokens. |
|
| 21 | + * |
|
| 22 | + * @param mixed $client |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 25 | + public function revokeClientTokens($client) |
|
| 26 | + { |
|
| 27 | + $client = is_int($client) ? $client : $this->find($client); |
|
| 28 | + $client->tokens()->update(['revoked' => true]); |
|
| 29 | + } |
|
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * Ensure access token hasn't expired or revoked. |
|
| 33 | - * |
|
| 34 | - * @param string $accessToken |
|
| 35 | - * @return boolean |
|
| 36 | - */ |
|
| 37 | - public function accessTokenExpiredOrRevoked($accessToken) |
|
| 38 | - { |
|
| 39 | - $accessTokenId = json_decode($accessToken, true)['id']; |
|
| 40 | - $accessToken = \DB::table('oauth_access_tokens') |
|
| 41 | - ->where('id', $accessTokenId) |
|
| 42 | - ->first(); |
|
| 31 | + /** |
|
| 32 | + * Ensure access token hasn't expired or revoked. |
|
| 33 | + * |
|
| 34 | + * @param string $accessToken |
|
| 35 | + * @return boolean |
|
| 36 | + */ |
|
| 37 | + public function accessTokenExpiredOrRevoked($accessToken) |
|
| 38 | + { |
|
| 39 | + $accessTokenId = json_decode($accessToken, true)['id']; |
|
| 40 | + $accessToken = \DB::table('oauth_access_tokens') |
|
| 41 | + ->where('id', $accessTokenId) |
|
| 42 | + ->first(); |
|
| 43 | 43 | |
| 44 | - if (\Carbon\Carbon::parse($accessToken->expires_at)->isPast() || $accessToken->revoked) { |
|
| 45 | - return true; |
|
| 46 | - } |
|
| 44 | + if (\Carbon\Carbon::parse($accessToken->expires_at)->isPast() || $accessToken->revoked) { |
|
| 45 | + return true; |
|
| 46 | + } |
|
| 47 | 47 | |
| 48 | - return false; |
|
| 49 | - } |
|
| 48 | + return false; |
|
| 49 | + } |
|
| 50 | 50 | |
| 51 | - /** |
|
| 52 | - * Revoke the given access token and all |
|
| 53 | - * associated refresh tokens. |
|
| 54 | - * |
|
| 55 | - * @param oject $accessToken |
|
| 56 | - * @return void |
|
| 57 | - */ |
|
| 58 | - public function revokeAccessToken($accessToken) |
|
| 59 | - { |
|
| 60 | - \DB::table('oauth_refresh_tokens') |
|
| 61 | - ->where('access_token_id', $accessToken->id) |
|
| 62 | - ->update([ |
|
| 63 | - 'revoked' => true |
|
| 64 | - ]); |
|
| 51 | + /** |
|
| 52 | + * Revoke the given access token and all |
|
| 53 | + * associated refresh tokens. |
|
| 54 | + * |
|
| 55 | + * @param oject $accessToken |
|
| 56 | + * @return void |
|
| 57 | + */ |
|
| 58 | + public function revokeAccessToken($accessToken) |
|
| 59 | + { |
|
| 60 | + \DB::table('oauth_refresh_tokens') |
|
| 61 | + ->where('access_token_id', $accessToken->id) |
|
| 62 | + ->update([ |
|
| 63 | + 'revoked' => true |
|
| 64 | + ]); |
|
| 65 | 65 | |
| 66 | - $accessToken->revoke(); |
|
| 67 | - } |
|
| 66 | + $accessToken->revoke(); |
|
| 67 | + } |
|
| 68 | 68 | } |
@@ -6,27 +6,27 @@ |
||
| 6 | 6 | |
| 7 | 7 | class AssignRelationsSeeder extends Seeder |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the database seeds. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function run() |
|
| 15 | - { |
|
| 16 | - $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id; |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + $adminRoleId = \DB::table('roles')->where('name', 'admin')->select('id')->first()->id; |
|
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * Assign the permissions to the admin role. |
|
| 20 | - */ |
|
| 21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminRoleId) { |
|
| 22 | - \DB::table('permission_role')->insert( |
|
| 23 | - [ |
|
| 24 | - 'permission_id' => $permission->id, |
|
| 25 | - 'role_id' => $adminRoleId, |
|
| 26 | - 'created_at' => \DB::raw('NOW()'), |
|
| 27 | - 'updated_at' => \DB::raw('NOW()') |
|
| 28 | - ] |
|
| 29 | - ); |
|
| 30 | - }); |
|
| 31 | - } |
|
| 18 | + /** |
|
| 19 | + * Assign the permissions to the admin role. |
|
| 20 | + */ |
|
| 21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminRoleId) { |
|
| 22 | + \DB::table('permission_role')->insert( |
|
| 23 | + [ |
|
| 24 | + 'permission_id' => $permission->id, |
|
| 25 | + 'role_id' => $adminRoleId, |
|
| 26 | + 'created_at' => \DB::raw('NOW()'), |
|
| 27 | + 'updated_at' => \DB::raw('NOW()') |
|
| 28 | + ] |
|
| 29 | + ); |
|
| 30 | + }); |
|
| 31 | + } |
|
| 32 | 32 | } |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | /** |
| 19 | 19 | * Assign the permissions to the admin role. |
| 20 | 20 | */ |
| 21 | - \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function ($permission) use ($adminRoleId) { |
|
| 21 | + \DB::table('permissions')->orderBy('created_at', 'asc')->whereIn('model', ['oauthClient'])->each(function($permission) use ($adminRoleId) { |
|
| 22 | 22 | \DB::table('permission_role')->insert( |
| 23 | 23 | [ |
| 24 | 24 | 'permission_id' => $permission->id, |
@@ -6,15 +6,15 @@ |
||
| 6 | 6 | |
| 7 | 7 | class ClearDataSeeder extends Seeder |
| 8 | 8 | { |
| 9 | - /** |
|
| 10 | - * Run the database seeds. |
|
| 11 | - * |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function run() |
|
| 15 | - { |
|
| 16 | - $permissions = \DB::table('permissions')->whereIn('model', ['oauthClient']); |
|
| 17 | - \DB::table('permission_role')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
| 18 | - $permissions->delete(); |
|
| 19 | - } |
|
| 9 | + /** |
|
| 10 | + * Run the database seeds. |
|
| 11 | + * |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function run() |
|
| 15 | + { |
|
| 16 | + $permissions = \DB::table('permissions')->whereIn('model', ['oauthClient']); |
|
| 17 | + \DB::table('permission_role')->whereIn('permission_id', $permissions->pluck('id'))->delete(); |
|
| 18 | + $permissions->delete(); |
|
| 19 | + } |
|
| 20 | 20 | } |
@@ -5,63 +5,63 @@ |
||
| 5 | 5 | |
| 6 | 6 | class OauthClientService extends BaseService |
| 7 | 7 | { |
| 8 | - /** |
|
| 9 | - * Init new object. |
|
| 10 | - * |
|
| 11 | - * @param OauthClientRepository $repo |
|
| 12 | - * @return void |
|
| 13 | - */ |
|
| 14 | - public function __construct(OauthClientRepository $repo) |
|
| 15 | - { |
|
| 16 | - parent::__construct($repo); |
|
| 17 | - } |
|
| 8 | + /** |
|
| 9 | + * Init new object. |
|
| 10 | + * |
|
| 11 | + * @param OauthClientRepository $repo |
|
| 12 | + * @return void |
|
| 13 | + */ |
|
| 14 | + public function __construct(OauthClientRepository $repo) |
|
| 15 | + { |
|
| 16 | + parent::__construct($repo); |
|
| 17 | + } |
|
| 18 | 18 | |
| 19 | - /** |
|
| 20 | - * Revoke the given client. |
|
| 21 | - * |
|
| 22 | - * @param integer $clientId |
|
| 23 | - * @return void |
|
| 24 | - */ |
|
| 25 | - public function revoke($clientId) |
|
| 26 | - { |
|
| 27 | - \DB::transaction(function () use ($data) { |
|
| 28 | - $client = $this->repo->find($clientId); |
|
| 29 | - $this->repo->revokeClientTokens($client); |
|
| 30 | - $this->repo->save(['id'=> $clientId, 'revoked' => true]); |
|
| 31 | - }); |
|
| 32 | - } |
|
| 19 | + /** |
|
| 20 | + * Revoke the given client. |
|
| 21 | + * |
|
| 22 | + * @param integer $clientId |
|
| 23 | + * @return void |
|
| 24 | + */ |
|
| 25 | + public function revoke($clientId) |
|
| 26 | + { |
|
| 27 | + \DB::transaction(function () use ($data) { |
|
| 28 | + $client = $this->repo->find($clientId); |
|
| 29 | + $this->repo->revokeClientTokens($client); |
|
| 30 | + $this->repo->save(['id'=> $clientId, 'revoked' => true]); |
|
| 31 | + }); |
|
| 32 | + } |
|
| 33 | 33 | |
| 34 | - /** |
|
| 35 | - * UnRevoke the given client. |
|
| 36 | - * |
|
| 37 | - * @param integer $clientId |
|
| 38 | - * @return void |
|
| 39 | - */ |
|
| 40 | - public function unRevoke($clientId) |
|
| 41 | - { |
|
| 42 | - $this->repo->save(['id'=> $clientId, 'revoked' => false]); |
|
| 43 | - } |
|
| 34 | + /** |
|
| 35 | + * UnRevoke the given client. |
|
| 36 | + * |
|
| 37 | + * @param integer $clientId |
|
| 38 | + * @return void |
|
| 39 | + */ |
|
| 40 | + public function unRevoke($clientId) |
|
| 41 | + { |
|
| 42 | + $this->repo->save(['id'=> $clientId, 'revoked' => false]); |
|
| 43 | + } |
|
| 44 | 44 | |
| 45 | - /** |
|
| 46 | - * Ensure access token hasn't expired or revoked. |
|
| 47 | - * |
|
| 48 | - * @param string $accessToken |
|
| 49 | - * @return boolean |
|
| 50 | - */ |
|
| 51 | - public function accessTokenExpiredOrRevoked($accessToken) |
|
| 52 | - { |
|
| 53 | - return $this->oauthClientRepository->accessTokenExpiredOrRevoked($accessToken); |
|
| 54 | - } |
|
| 45 | + /** |
|
| 46 | + * Ensure access token hasn't expired or revoked. |
|
| 47 | + * |
|
| 48 | + * @param string $accessToken |
|
| 49 | + * @return boolean |
|
| 50 | + */ |
|
| 51 | + public function accessTokenExpiredOrRevoked($accessToken) |
|
| 52 | + { |
|
| 53 | + return $this->oauthClientRepository->accessTokenExpiredOrRevoked($accessToken); |
|
| 54 | + } |
|
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * Revoke the given access token and all |
|
| 58 | - * associated refresh tokens. |
|
| 59 | - * |
|
| 60 | - * @param oject $accessToken |
|
| 61 | - * @return void |
|
| 62 | - */ |
|
| 63 | - public function revokeAccessToken($accessToken) |
|
| 64 | - { |
|
| 65 | - return $this->oauthClientRepository->revokeAccessToken($accessToken); |
|
| 66 | - } |
|
| 56 | + /** |
|
| 57 | + * Revoke the given access token and all |
|
| 58 | + * associated refresh tokens. |
|
| 59 | + * |
|
| 60 | + * @param oject $accessToken |
|
| 61 | + * @return void |
|
| 62 | + */ |
|
| 63 | + public function revokeAccessToken($accessToken) |
|
| 64 | + { |
|
| 65 | + return $this->oauthClientRepository->revokeAccessToken($accessToken); |
|
| 66 | + } |
|
| 67 | 67 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | */ |
| 25 | 25 | public function revoke($clientId) |
| 26 | 26 | { |
| 27 | - \DB::transaction(function () use ($data) { |
|
| 27 | + \DB::transaction(function() use ($data) { |
|
| 28 | 28 | $client = $this->repo->find($clientId); |
| 29 | 29 | $this->repo->revokeClientTokens($client); |
| 30 | 30 | $this->repo->save(['id'=> $clientId, 'revoked' => true]); |