FIX: fix login

Login should work again. Problem was in non-setting sessions. This was resolved by adding middleware "web" to admin group. Thanks to great documentation for NOT MENTIONING this pitfall!
This commit is contained in:
Michal Kváček
2016-01-24 15:08:59 +01:00
parent 2ade14beba
commit 8a91a95a67
11 changed files with 40 additions and 80 deletions
+6 -5
View File
@@ -10,19 +10,20 @@ class Authenticate
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (!Auth::check($guard)) {
if (!Auth::guard($guard)->check()) {
if ($request->ajax()) {
return response('Unauthorized.', 401);
}
return redirect()->guest('login');
return redirect()->route('login');
}
return $next($request);