adrema/app/Http/Middleware/Authenticate.php

23 lines
473 B
PHP
Raw Normal View History

2020-04-10 20:32:12 +02:00
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
2022-03-11 20:19:17 +01:00
* @param \Illuminate\Http\Request $request
*
2020-04-10 20:32:12 +02:00
* @return string|null
*/
protected function redirectTo($request)
{
2022-03-11 20:19:17 +01:00
if (!$request->expectsJson()) {
2020-04-10 20:32:12 +02:00
return route('login');
}
}
}