File tree Expand file tree Collapse file tree 2 files changed +16
-9
lines changed
Expand file tree Collapse file tree 2 files changed +16
-9
lines changed Original file line number Diff line number Diff line change @@ -202,16 +202,20 @@ public function logout()
202202 {
203203 $ user = $ this ->user ();
204204
205- if ($ this ->user && ($ tokenRemember = $ this ->user ->getRememberToken ())) {
206- $ tokenRemember ->delete ();
207- }
205+ $ recaller = $ this ->recaller ();
208206
209- $ this ->session ->remove ($ this ->getName ());
207+ if ($ recaller !== null ) {
208+ $ tokenRemember = $ user ->getRememberToken ($ recaller ->token ());
209+
210+ if ($ tokenRemember ) {
211+ $ tokenRemember ->delete ();
212+ }
210213
211- if (! is_null ($ this ->recaller ())) {
212214 $ this ->cookies ->get ($ this ->getRememberName ())->delete ();
213215 }
214216
217+ $ this ->session ->remove ($ this ->getName ());
218+
215219 $ this ->event (new Logout ($ user ));
216220
217221 $ this ->user = null ;
Original file line number Diff line number Diff line change 1111 */
1212class Authenticate extends Injectable implements AuthenticatesRequest
1313{
14- private const PROPERTY_AUTH_ACCESS = "authAccess " ;
14+ private const PROPERTY_AUTH_ACCESS = "authAccess " ;
15+ private const AUTH_ACCESS_BY_DEFAULT = true ;
1516
1617 /**
1718 * @var Dispatcher
@@ -60,8 +61,10 @@ protected function isGuest()
6061 {
6162 $ controller = $ this ->dispatcher ->getControllerClass ();
6263
63- return !(new $ controller )->authAccess () ||
64- (property_exists ($ controller , self ::PROPERTY_AUTH_ACCESS ) &&
65- (new $ controller )->authAccess === false );
64+ $ authAccess = property_exists ($ controller , self ::PROPERTY_AUTH_ACCESS ) ?
65+ (new $ controller )->authAccess : self ::AUTH_ACCESS_BY_DEFAULT ;
66+
67+ return (method_exists ($ controller , 'authAccess ' ) &&
68+ !(new $ controller )->authAccess ()) || $ authAccess === false ;
6669 }
6770}
You can’t perform that action at this time.
0 commit comments