Revert OAuth2.0
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Enums\GoogleService;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Support\Facades\Crypt;
|
||||
|
||||
class GoogleOAuthConnection extends Model
|
||||
{
|
||||
protected $fillable = [
|
||||
'service',
|
||||
'client_id',
|
||||
'client_secret',
|
||||
'refresh_token',
|
||||
];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return [
|
||||
'service' => GoogleService::class,
|
||||
];
|
||||
}
|
||||
|
||||
public function getClientSecretAttribute(?string $value): ?string
|
||||
{
|
||||
return $value ? Crypt::decryptString($value) : null;
|
||||
}
|
||||
|
||||
public function setClientSecretAttribute(?string $value): void
|
||||
{
|
||||
$this->attributes['client_secret'] = $value ? Crypt::encryptString($value) : null;
|
||||
}
|
||||
|
||||
public function getRefreshTokenAttribute(?string $value): ?string
|
||||
{
|
||||
return $value ? Crypt::decryptString($value) : null;
|
||||
}
|
||||
|
||||
public function setRefreshTokenAttribute(?string $value): void
|
||||
{
|
||||
$this->attributes['refresh_token'] = $value ? Crypt::encryptString($value) : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user