Skip to content

Commit 44bbf2c

Browse files
authored
Merge pull request #576 from cornejobarraza/logOutError
bug: Call to a member function inGroup() on null after logging out
2 parents aba50df + 27db557 commit 44bbf2c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Controllers/LoginController.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ protected function getValidationRules(): array
101101
*/
102102
public function logoutAction(): RedirectResponse
103103
{
104+
// Capture logout redirect URL before auth logout,
105+
// otherwise you cannot check the user in `logoutRedirect()`.
106+
$url = config('Auth')->logoutRedirect();
107+
104108
auth()->logout();
105109

106-
return redirect()->to(config('Auth')->logoutRedirect())->with('message', lang('Auth.successLogout'));
110+
return redirect()->to($url)->with('message', lang('Auth.successLogout'));
107111
}
108112
}

0 commit comments

Comments
 (0)