From ff0f756a1e8a11072f7583e907601088061cd146 Mon Sep 17 00:00:00 2001 From: Pavel W Date: Fri, 3 Jul 2020 00:09:09 +0200 Subject: [PATCH 1/2] Added method User::refresh() to clear identity cache. (#46) --- src/Security/User.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Security/User.php b/src/Security/User.php index 26dc440c..1f6cd8f7 100644 --- a/src/Security/User.php +++ b/src/Security/User.php @@ -302,6 +302,17 @@ final public function getAuthorizatorIfExists(): ?IAuthorizator } + /** + * Clear identity cache. + * @return $this + */ + final public function refresh() + { + $this->identity = false; + return $this; + } + + /** @deprecated */ final public function hasAuthorizator(): bool { From b29c3947e9c53d5ded642e059e1446c73cf656ed Mon Sep 17 00:00:00 2001 From: Pavel W Date: Fri, 17 Jul 2020 16:32:56 +0200 Subject: [PATCH 2/2] Update User.php Fix - clear $this->authenticated --- src/Security/User.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Security/User.php b/src/Security/User.php index 1f6cd8f7..7b6054c7 100644 --- a/src/Security/User.php +++ b/src/Security/User.php @@ -309,6 +309,7 @@ final public function getAuthorizatorIfExists(): ?IAuthorizator final public function refresh() { $this->identity = false; + $this->authenticated = null; return $this; }