From 670a447ebcecb81675045aa4c624488ee374512d Mon Sep 17 00:00:00 2001 From: Alexander Menshchikov Date: Sat, 5 Jun 2021 12:44:48 +0300 Subject: [PATCH] Fix #168 --- CHANGELOG.md | 4 ++++ Security/Authentication/Provider/SamlProvider.php | 4 ---- Security/Http/Authenticator/SamlAuthenticator.php | 4 ---- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ea711..f973df3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.3.3 + + * Reverted BC break (persistence SamlUser after calling setSamlAttributes). + ## 2.3.2 * Added persistence SamlUser after calling setSamlAttributes while authentication. diff --git a/Security/Authentication/Provider/SamlProvider.php b/Security/Authentication/Provider/SamlProvider.php index f046482..d482e46 100644 --- a/Security/Authentication/Provider/SamlProvider.php +++ b/Security/Authentication/Provider/SamlProvider.php @@ -53,10 +53,6 @@ public function authenticate(TokenInterface $token) if ($user) { if ($user instanceof SamlUserInterface) { $user->setSamlAttributes($token->getAttributes()); - if ($this->entityManager) { - $this->entityManager->persist($user); - $this->entityManager->flush(); - } } $authenticatedToken = $this->tokenFactory->createToken($user, $token->getAttributes(), $user->getRoles()); diff --git a/Security/Http/Authenticator/SamlAuthenticator.php b/Security/Http/Authenticator/SamlAuthenticator.php index 20587dc..32ea480 100644 --- a/Security/Http/Authenticator/SamlAuthenticator.php +++ b/Security/Http/Authenticator/SamlAuthenticator.php @@ -138,10 +138,6 @@ function ($identifier) use ($attributes) { if ($user instanceof SamlUserInterface) { $user->setSamlAttributes($attributes); - if ($this->entityManager) { - $this->entityManager->persist($user); - $this->entityManager->flush(); - } } return $user;