fix oauth client secret

This commit is contained in:
xiaomlove
2024-03-18 02:57:55 +08:00
parent 3e96d18b48
commit 73bd3a1eaa
3 changed files with 10 additions and 3 deletions
@@ -6,7 +6,7 @@ use App\Filament\OptionsTrait;
use App\Filament\PageListSingle;
use App\Filament\Resources\Oauth\ClientResource\Pages;
use App\Filament\Resources\Oauth\ClientResource\RelationManagers;
use Laravel\Passport\Client;
use App\Models\OauthClient;
use Filament\Forms;
use Filament\Resources\Form;
use Filament\Resources\Resource;
@@ -19,7 +19,7 @@ class ClientResource extends Resource
{
use OptionsTrait;
protected static ?string $model = Client::class;
protected static ?string $model = OauthClient::class;
protected static ?string $navigationIcon = 'heroicon-o-collection';
+7
View File
@@ -2,10 +2,17 @@
namespace App\Models;
use Illuminate\Support\Str;
use Laravel\Passport\Client;
class OauthClient extends Client
{
protected static function booted(): void
{
static::creating(function (OauthClient $model) {
$model->secret = Str::random(40);
});
}
public function skipsAuthorization(): bool
{
return (bool)$this->skips_authorization;
+1 -1
View File
@@ -1,6 +1,6 @@
<?php
defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.8.9');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-03-17');
defined('RELEASE_DATE') || define('RELEASE_DATE', '2024-03-18');
defined('IN_TRACKER') || define('IN_TRACKER', false);
defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP");
defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org");