Skip to content

Commit 594b889

Browse files
committed
Hash passport client id
Signed-off-by: Mark Clu Heramis <chumheramis@gmail.com>
1 parent b5db707 commit 594b889

File tree

4 files changed

+36
-4
lines changed

4 files changed

+36
-4
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
namespace App\Providers;
4-
4+
use Laravel\Passport\Passport;
55
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
66
use Illuminate\Support\Facades\Schema;
77
use App\Models\User;
@@ -47,7 +47,7 @@ protected function registerTelescope() {
4747
$this->app->register(TelescopeServiceProvider::class);
4848
}
4949
}
50-
50+
5151
protected function registerRole() {
5252
$this->app->singleton('roles', function($app) {
5353
return new RoleRepository();
@@ -83,6 +83,7 @@ protected function registerActivation() {
8383
* @return void
8484
*/
8585
public function boot() {
86+
Passport::hashClientSecrets();
8687
if (config('app.env') !== 'local') {
8788
\URL::forceScheme('https');
8889
}

app/Providers/AuthServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,5 @@ public function boot()
4141
# End Expiry Configuration
4242
Passport::enableImplicitGrant();
4343
Passport::tokensCan(config('permissions'));
44-
Passport::hashClientSecrets();
4544
}
4645
}

config/passport.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
|
2929
*/
3030

31-
'client_uuids' => false,
31+
'client_uuids' => true,
3232

3333
/*
3434
|--------------------------------------------------------------------------
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
use Illuminate\Database\Migrations\Migration;
4+
use Illuminate\Database\Schema\Blueprint;
5+
use Illuminate\Support\Facades\Schema;
6+
7+
return new class extends Migration
8+
{
9+
/**
10+
* Run the migrations.
11+
*
12+
* @return void
13+
*/
14+
public function up()
15+
{
16+
Schema::table('oauth_clients', function (Blueprint $table) {
17+
$table->uuid('id')->change();
18+
});
19+
}
20+
21+
/**
22+
* Reverse the migrations.
23+
*
24+
* @return void
25+
*/
26+
public function down()
27+
{
28+
Schema::table('oauth_clients', function (Blueprint $table) {
29+
$table->bigIncrements('id')->change();
30+
});
31+
}
32+
};

0 commit comments

Comments
 (0)