Fix landing page issue
This commit is contained in:
		@@ -5,8 +5,8 @@ namespace App\Exceptions;
 | 
				
			|||||||
use Illuminate\Auth\AuthenticationException;
 | 
					use Illuminate\Auth\AuthenticationException;
 | 
				
			||||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
 | 
					use Illuminate\Database\Eloquent\ModelNotFoundException;
 | 
				
			||||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 | 
					use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
 | 
				
			||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 | 
					 | 
				
			||||||
use Symfony\Component\Debug\Exception\FatalThrowableError;
 | 
					use Symfony\Component\Debug\Exception\FatalThrowableError;
 | 
				
			||||||
 | 
					use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
 | 
				
			||||||
use Throwable;
 | 
					use Throwable;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class Handler extends ExceptionHandler
 | 
					class Handler extends ExceptionHandler
 | 
				
			||||||
@@ -71,11 +71,13 @@ class Handler extends ExceptionHandler
 | 
				
			|||||||
    protected function unauthenticated($request, AuthenticationException $exception)
 | 
					    protected function unauthenticated($request, AuthenticationException $exception)
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
        // Store the current url in the session
 | 
					        // Store the current url in the session
 | 
				
			||||||
 | 
					        if ($request->url() !== config('app.url')) {
 | 
				
			||||||
            session(['url.intended' => $request->url()]);
 | 
					            session(['url.intended' => $request->url()]);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return $request->expectsJson()
 | 
					        return $request->expectsJson()
 | 
				
			||||||
            ? response()->json(['message' => $exception->getMessage()], 401)
 | 
					            ? response()->json(['message' => $exception->getMessage()], 401)
 | 
				
			||||||
                    : redirect()->guest($exception->redirectTo() ?? route('login'));
 | 
					            : redirect()->to($exception->redirectTo() ?? route('login'));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    private function handleExceptions($request, $exception)
 | 
					    private function handleExceptions($request, $exception)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user