@@ -1,7 +1,6 @@ |
||
1 | 1 | <?php namespace Nord\Lumen\OAuth2\Eloquent\Storages; |
2 | 2 | |
3 | 3 | use Carbon\Carbon; |
4 | -use Illuminate\Support\Facades\Log; |
|
5 | 4 | use League\OAuth2\Server\Entity\RefreshTokenEntity; |
6 | 5 | use League\OAuth2\Server\Storage\RefreshTokenInterface; |
7 | 6 | use Nord\Lumen\OAuth2\Eloquent\Models\AccessToken; |
@@ -30,23 +30,23 @@ |
||
30 | 30 | */ |
31 | 31 | protected function registerContainerBindings(Container $container) |
32 | 32 | { |
33 | - $container->bind(AccessTokenStorage::class, function () { |
|
33 | + $container->bind(AccessTokenStorage::class, function() { |
|
34 | 34 | return new AccessTokenStorage; |
35 | 35 | }); |
36 | 36 | |
37 | - $container->bind(ClientStorage::class, function () { |
|
37 | + $container->bind(ClientStorage::class, function() { |
|
38 | 38 | return new ClientStorage; |
39 | 39 | }); |
40 | 40 | |
41 | - $container->bind(RefreshTokenStorage::class, function () { |
|
41 | + $container->bind(RefreshTokenStorage::class, function() { |
|
42 | 42 | return new RefreshTokenStorage; |
43 | 43 | }); |
44 | 44 | |
45 | - $container->bind(ScopeStorage::class, function () { |
|
45 | + $container->bind(ScopeStorage::class, function() { |
|
46 | 46 | return new ScopeStorage; |
47 | 47 | }); |
48 | 48 | |
49 | - $container->bind(SessionStorage::class, function () { |
|
49 | + $container->bind(SessionStorage::class, function() { |
|
50 | 50 | return new SessionStorage; |
51 | 51 | }); |
52 | 52 |
@@ -33,23 +33,23 @@ |
||
33 | 33 | { |
34 | 34 | $entityManager = $container->make(EntityManagerInterface::class); |
35 | 35 | |
36 | - $container->bind(AccessTokenStorage::class, function () use ($entityManager) { |
|
36 | + $container->bind(AccessTokenStorage::class, function() use ($entityManager) { |
|
37 | 37 | return new AccessTokenStorage($entityManager); |
38 | 38 | }); |
39 | 39 | |
40 | - $container->bind(ClientStorage::class, function () use ($entityManager) { |
|
40 | + $container->bind(ClientStorage::class, function() use ($entityManager) { |
|
41 | 41 | return new ClientStorage($entityManager); |
42 | 42 | }); |
43 | 43 | |
44 | - $container->bind(RefreshTokenStorage::class, function () use ($entityManager) { |
|
44 | + $container->bind(RefreshTokenStorage::class, function() use ($entityManager) { |
|
45 | 45 | return new RefreshTokenStorage($entityManager); |
46 | 46 | }); |
47 | 47 | |
48 | - $container->bind(ScopeStorage::class, function () use ($entityManager) { |
|
48 | + $container->bind(ScopeStorage::class, function() use ($entityManager) { |
|
49 | 49 | return new ScopeStorage($entityManager); |
50 | 50 | }); |
51 | 51 | |
52 | - $container->bind(SessionStorage::class, function () use ($entityManager) { |
|
52 | + $container->bind(SessionStorage::class, function() use ($entityManager) { |
|
53 | 53 | return new SessionStorage($entityManager); |
54 | 54 | }); |
55 | 55 |
@@ -42,7 +42,7 @@ |
||
42 | 42 | */ |
43 | 43 | protected function registerBindings(Container $container, ConfigRepository $config) |
44 | 44 | { |
45 | - $container->bind(OAuth2Service::class, function ($container) use ($config) { |
|
45 | + $container->bind(OAuth2Service::class, function($container) use ($config) { |
|
46 | 46 | return $this->createService($container, $config[self::CONFIG_KEY]); |
47 | 47 | }); |
48 | 48 |
@@ -5,32 +5,32 @@ |
||
5 | 5 | |
6 | 6 | class CreateOauthAccessTokensTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('oauth_access_tokens', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->increments('id'); |
|
18 | - $table->integer('session_id')->unsigned(); |
|
19 | - $table->string('token'); |
|
20 | - $table->dateTime('expire_time'); |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('oauth_access_tokens', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->increments('id'); |
|
18 | + $table->integer('session_id')->unsigned(); |
|
19 | + $table->string('token'); |
|
20 | + $table->dateTime('expire_time'); |
|
21 | 21 | |
22 | - $table->foreign('session_id')->references('id')->on('oauth_sessions'); |
|
23 | - }); |
|
24 | - } |
|
22 | + $table->foreign('session_id')->references('id')->on('oauth_sessions'); |
|
23 | + }); |
|
24 | + } |
|
25 | 25 | |
26 | - /** |
|
27 | - * Reverse the migrations. |
|
28 | - * |
|
29 | - * @return void |
|
30 | - */ |
|
31 | - public function down() |
|
32 | - { |
|
33 | - Schema::drop('oauth_access_tokens'); |
|
34 | - } |
|
26 | + /** |
|
27 | + * Reverse the migrations. |
|
28 | + * |
|
29 | + * @return void |
|
30 | + */ |
|
31 | + public function down() |
|
32 | + { |
|
33 | + Schema::drop('oauth_access_tokens'); |
|
34 | + } |
|
35 | 35 | |
36 | 36 | } |
@@ -5,33 +5,33 @@ |
||
5 | 5 | |
6 | 6 | class CreateOauthSessionsTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('oauth_sessions', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->increments('id'); |
|
18 | - $table->integer('client_id')->unsigned(); |
|
19 | - $table->string('owner_type'); |
|
20 | - $table->string('owner_id'); |
|
21 | - $table->string('client_redirect_uri')->nullable(); |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('oauth_sessions', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->increments('id'); |
|
18 | + $table->integer('client_id')->unsigned(); |
|
19 | + $table->string('owner_type'); |
|
20 | + $table->string('owner_id'); |
|
21 | + $table->string('client_redirect_uri')->nullable(); |
|
22 | 22 | |
23 | - $table->foreign('client_id')->references('id')->on('oauth_clients'); |
|
24 | - }); |
|
25 | - } |
|
23 | + $table->foreign('client_id')->references('id')->on('oauth_clients'); |
|
24 | + }); |
|
25 | + } |
|
26 | 26 | |
27 | - /** |
|
28 | - * Reverse the migrations. |
|
29 | - * |
|
30 | - * @return void |
|
31 | - */ |
|
32 | - public function down() |
|
33 | - { |
|
34 | - Schema::drop('oauth_sessions'); |
|
35 | - } |
|
27 | + /** |
|
28 | + * Reverse the migrations. |
|
29 | + * |
|
30 | + * @return void |
|
31 | + */ |
|
32 | + public function down() |
|
33 | + { |
|
34 | + Schema::drop('oauth_sessions'); |
|
35 | + } |
|
36 | 36 | |
37 | 37 | } |
@@ -5,30 +5,30 @@ |
||
5 | 5 | |
6 | 6 | class CreateOauthClientsTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('oauth_clients', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->increments('id'); |
|
18 | - $table->string('key')->unique(); |
|
19 | - $table->string('secret'); |
|
20 | - $table->string('name'); |
|
21 | - }); |
|
22 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('oauth_clients', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->increments('id'); |
|
18 | + $table->string('key')->unique(); |
|
19 | + $table->string('secret'); |
|
20 | + $table->string('name'); |
|
21 | + }); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * Reverse the migrations. |
|
26 | - * |
|
27 | - * @return void |
|
28 | - */ |
|
29 | - public function down() |
|
30 | - { |
|
31 | - Schema::drop('oauth_clients'); |
|
32 | - } |
|
24 | + /** |
|
25 | + * Reverse the migrations. |
|
26 | + * |
|
27 | + * @return void |
|
28 | + */ |
|
29 | + public function down() |
|
30 | + { |
|
31 | + Schema::drop('oauth_clients'); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | } |
@@ -5,30 +5,30 @@ |
||
5 | 5 | |
6 | 6 | class CreateOauthRefreshTokensTable extends Migration { |
7 | 7 | |
8 | - /** |
|
9 | - * Run the migrations. |
|
10 | - * |
|
11 | - * @return void |
|
12 | - */ |
|
13 | - public function up() |
|
14 | - { |
|
15 | - Schema::create('oauth_refresh_tokens', function(Blueprint $table) |
|
16 | - { |
|
17 | - $table->increments('id'); |
|
18 | - $table->integer('access_token_id')->unsigned(); |
|
19 | - $table->string('token'); |
|
20 | - $table->dateTime('expire_time'); |
|
21 | - }); |
|
22 | - } |
|
8 | + /** |
|
9 | + * Run the migrations. |
|
10 | + * |
|
11 | + * @return void |
|
12 | + */ |
|
13 | + public function up() |
|
14 | + { |
|
15 | + Schema::create('oauth_refresh_tokens', function(Blueprint $table) |
|
16 | + { |
|
17 | + $table->increments('id'); |
|
18 | + $table->integer('access_token_id')->unsigned(); |
|
19 | + $table->string('token'); |
|
20 | + $table->dateTime('expire_time'); |
|
21 | + }); |
|
22 | + } |
|
23 | 23 | |
24 | - /** |
|
25 | - * Reverse the migrations. |
|
26 | - * |
|
27 | - * @return void |
|
28 | - */ |
|
29 | - public function down() |
|
30 | - { |
|
31 | - Schema::drop('oauth_refresh_tokens'); |
|
32 | - } |
|
24 | + /** |
|
25 | + * Reverse the migrations. |
|
26 | + * |
|
27 | + * @return void |
|
28 | + */ |
|
29 | + public function down() |
|
30 | + { |
|
31 | + Schema::drop('oauth_refresh_tokens'); |
|
32 | + } |
|
33 | 33 | |
34 | 34 | } |