File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -129,12 +129,7 @@ public function login($user, string $password = null): void
129129 */
130130 final public function logout (bool $ clearIdentity = false ): void
131131 {
132- if ($ this ->isLoggedIn ()) {
133- Arrays::invoke ($ this ->onLoggedOut , $ this );
134- }
135-
136- $ this ->authenticated = false ;
137- $ this ->identity = $ clearIdentity ? null : $ this ->identity ;
132+ $ logged = $ this ->isLoggedIn ();
138133
139134 if ($ this ->storage instanceof UserStorage) {
140135 $ this ->storage ->clearAuthentication ($ clearIdentity );
@@ -143,8 +138,14 @@ final public function logout(bool $clearIdentity = false): void
143138 if ($ clearIdentity ) {
144139 $ this ->storage ->setIdentity (null );
145140 }
146- $ this ->logoutReason = self ::MANUAL ;
147141 }
142+
143+ $ this ->authenticated = false ;
144+ $ this ->logoutReason = self ::MANUAL ;
145+ if ($ logged ) {
146+ Arrays::invoke ($ this ->onLoggedOut , $ this );
147+ }
148+ $ this ->identity = $ clearIdentity ? null : $ this ->identity ;
148149 }
149150
150151
You can’t perform that action at this time.
0 commit comments