Skip to content

Commit

Permalink
Merge pull request #576 from cornejobarraza/logOutError
Browse files Browse the repository at this point in the history
bug: Call to a member function inGroup() on null after logging out
  • Loading branch information
datamweb authored Jan 6, 2023
2 parents aba50df + 27db557 commit 44bbf2c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Controllers/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,12 @@ protected function getValidationRules(): array
*/
public function logoutAction(): RedirectResponse
{
// Capture logout redirect URL before auth logout,
// otherwise you cannot check the user in `logoutRedirect()`.
$url = config('Auth')->logoutRedirect();

auth()->logout();

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

0 comments on commit 44bbf2c

Please sign in to comment.