mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fix oauth client secret
This commit is contained in:
@@ -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';
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user