mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-08 20:22:42 +01:00
Redirect /login and /recover_password if logged in
This commit is contained in:
parent
8fae734490
commit
dcbb9458dc
@ -117,6 +117,10 @@ class AuthController extends Controller
|
||||
*/
|
||||
public function getLoginWrapper()
|
||||
{
|
||||
if (auth()->check()) {
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
if (! Utils::isNinja() && ! User::count()) {
|
||||
return redirect()->to('/setup');
|
||||
}
|
||||
|
@ -35,4 +35,18 @@ class PasswordController extends Controller
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
|
||||
/**
|
||||
* Display the form to request a password reset link.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function getEmailWrapper()
|
||||
{
|
||||
if (auth()->check()) {
|
||||
return redirect('/');
|
||||
}
|
||||
|
||||
return $this->getEmail();
|
||||
}
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ Route::get('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@getRegis
|
||||
Route::post('/signup', ['as' => 'signup', 'uses' => 'Auth\AuthController@postRegister']);
|
||||
Route::get('/login', ['as' => 'login', 'uses' => 'Auth\AuthController@getLoginWrapper']);
|
||||
Route::get('/logout', ['as' => 'logout', 'uses' => 'Auth\AuthController@getLogoutWrapper']);
|
||||
Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmail']);
|
||||
Route::get('/recover_password', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getEmailWrapper']);
|
||||
Route::get('/password/reset/{token}', ['as' => 'forgot', 'uses' => 'Auth\PasswordController@getReset']);
|
||||
Route::get('/auth/{provider}', 'Auth\AuthController@authLogin');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user