2020-10-30 17:26:00 +01: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-09-03 16:56:16 +02:00
|
|
|
* @param mixed $request
|
2020-10-30 17:26:00 +01:00
|
|
|
* @return string|null
|
|
|
|
|
*/
|
|
|
|
|
protected function redirectTo($request)
|
|
|
|
|
{
|
|
|
|
|
if (! $request->expectsJson()) {
|
2020-11-02 14:47:11 +01:00
|
|
|
return route('auth.login');
|
2020-10-30 17:26:00 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|