Skip to content

Commit

Permalink
Allow users to set redirectAfterLogout path
Browse files Browse the repository at this point in the history
Reproduce lost #8132 PR
  • Loading branch information
Maxim Lanin committed Dec 15, 2016
1 parent c79269b commit 31ff2b7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Foundation/Auth/AuthenticatesUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function username()
/**
* Log the user out of the application.
*
* @param \Illuminate\Http\Request $request
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function logout(Request $request)
Expand All @@ -155,7 +155,7 @@ public function logout(Request $request)

$request->session()->regenerate();

return redirect('/');
return redirect($this->redirectAfterLogoutPath());
}

/**
Expand Down
10 changes: 10 additions & 0 deletions src/Illuminate/Foundation/Auth/RedirectsUsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,14 @@ public function redirectPath()
{
return property_exists($this, 'redirectTo') ? $this->redirectTo : '/home';
}

/**
* Get the post logout redirect path.
*
* @return string
*/
public function redirectAfterLogoutPath()
{
return property_exists($this, 'redirectAfterLogout') ? $this->redirectAfterLogout : '/';
}
}

0 comments on commit 31ff2b7

Please sign in to comment.