From bbc80491d112874f376dc5f68dd51a1aefad6c0e Mon Sep 17 00:00:00 2001 From: "tim.messaoudene" Date: Thu, 29 Aug 2024 14:50:39 +0200 Subject: [PATCH 1/2] Fix set user locale for google user --- src/Factory/AdminUserFactory.php | 4 ++-- src/Security/Resolver/DomainInformationsResolver.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Factory/AdminUserFactory.php b/src/Factory/AdminUserFactory.php index 4078900..4c8f227 100644 --- a/src/Factory/AdminUserFactory.php +++ b/src/Factory/AdminUserFactory.php @@ -10,7 +10,7 @@ final class AdminUserFactory { - public static function createByGoogleAccount(GoogleUser $googleUser): customAdminUser + public static function createByGoogleAccount(GoogleUser $googleUser, string $locale): customAdminUser { $user = new customAdminUser(); $user->setEmail($googleUser->getEmail()); @@ -21,7 +21,7 @@ public static function createByGoogleAccount(GoogleUser $googleUser): customAdmi $user->setHostedDomain($googleUser->getHostedDomain()); $user->setEnabled(true); $user->setCreatedAt(new \DateTimeImmutable('now')); - $user->setLocaleCode($googleUser->getLocale()); + $user->setLocaleCode($locale); /** @var string|null $googleId */ $googleId = $googleUser->getId(); $user->setGoogleId($googleId); diff --git a/src/Security/Resolver/DomainInformationsResolver.php b/src/Security/Resolver/DomainInformationsResolver.php index df6a877..f519945 100644 --- a/src/Security/Resolver/DomainInformationsResolver.php +++ b/src/Security/Resolver/DomainInformationsResolver.php @@ -35,7 +35,7 @@ public function getDomainInformations(AzureResourceOwner|GoogleUser $user): arra } /** @var AdminUser $newUser */ - $newUser = AdminUserFactory::createByGoogleAccount($user); + $newUser = AdminUserFactory::createByGoogleAccount($user, $this->localeContext->getLocaleCode()); return [ GoogleUser::class => [ From 3bee75971fad49340ffa08d0c1030d3bc589d725 Mon Sep 17 00:00:00 2001 From: "tim.messaoudene" Date: Thu, 12 Sep 2024 09:43:26 +0200 Subject: [PATCH 2/2] Exclude symfony 5.4 with sylius 1.12 --- .github/workflows/sylius.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/sylius.yaml b/.github/workflows/sylius.yaml index 0e31b8d..4cc7576 100644 --- a/.github/workflows/sylius.yaml +++ b/.github/workflows/sylius.yaml @@ -34,6 +34,9 @@ jobs: - sylius: 1.11.0 symfony: 6.3 + - + sylius: 1.12.0 + symfony: 5.4 env: APP_ENV: test package-name: synolia/sylius-admin-oauth-plugin