From 481a63ccdaef437d713a457372e41acfab9a0f8f Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Mon, 13 Apr 2026 16:21:09 +0200 Subject: [PATCH] feat: use custom entity class for OAuth2Clients with consented property --- config/packages/league_oauth2_server.yaml | 2 ++ migrations/Version20260413141741.php | 26 ++++++++++++++++++ src/Entity/OAuth2Client.php | 33 +++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 migrations/Version20260413141741.php create mode 100644 src/Entity/OAuth2Client.php diff --git a/config/packages/league_oauth2_server.yaml b/config/packages/league_oauth2_server.yaml index 5f4f444..cfdec5f 100644 --- a/config/packages/league_oauth2_server.yaml +++ b/config/packages/league_oauth2_server.yaml @@ -1,4 +1,6 @@ league_oauth2_server: + client: + classname: App\Entity\OAuth2Client authorization_server: private_key: '%env(resolve:OAUTH_PRIVATE_KEY)%' private_key_passphrase: '%env(resolve:OAUTH_PASSPHRASE)%' diff --git a/migrations/Version20260413141741.php b/migrations/Version20260413141741.php new file mode 100644 index 0000000..485bc7d --- /dev/null +++ b/migrations/Version20260413141741.php @@ -0,0 +1,26 @@ +addSql('ALTER TABLE oauth2_client ADD is_consented TINYINT(1) NOT NULL'); + } + + public function down(Schema $schema): void + { + $this->addSql('ALTER TABLE oauth2_client DROP is_consented'); + } +} diff --git a/src/Entity/OAuth2Client.php b/src/Entity/OAuth2Client.php new file mode 100644 index 0000000..1d5136e --- /dev/null +++ b/src/Entity/OAuth2Client.php @@ -0,0 +1,33 @@ +isConsented; + } + + public function setConsented(bool $isConsented): void + { + $this->isConsented = $isConsented; + } +}