Fix redirect loop.

This commit is contained in:
James Cole 2015-11-01 08:03:41 +01:00
parent f50244a41f
commit 9f992f003d
2 changed files with 17 additions and 2 deletions

View File

@ -13,6 +13,7 @@ use Request as Rq;
use Session; use Session;
use Twig; use Twig;
use Validator; use Validator;
use Log;
/** /**
* Class AuthController * Class AuthController
@ -23,6 +24,19 @@ class AuthController extends Controller
{ {
use AuthenticatesAndRegistersUsers, ThrottlesLogins; use AuthenticatesAndRegistersUsers, ThrottlesLogins;
/**
* Log the user out of the application.
*
* @return \Illuminate\Http\Response
*/
public function getLogout()
{
Auth::logout();
Log::debug('Logout and redirect to root.');
return redirect('/login');
}
/** /**
* Show the application registration form. * Show the application registration form.
* *

View File

@ -7,7 +7,7 @@ use Config;
use Illuminate\Contracts\Auth\Guard; use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Preferences; use Preferences;
use Auth;
/** /**
* Class Authenticate * Class Authenticate
* *
@ -54,7 +54,8 @@ class Authenticate
} }
if (intval($this->auth->user()->blocked) == 1) { if (intval($this->auth->user()->blocked) == 1) {
return redirect()->route('logout'); Auth::logout();
return redirect()->route('index');
} }
// if logged in, set user language: // if logged in, set user language: