2019-05-09 15:00:05 +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-04-19 16:07:27 +02:00
|
|
|
* @param \Illuminate\Http\Request $request
|
2022-04-19 10:49:38 +02:00
|
|
|
* @return string|null
|
2022-04-20 15:23:31 +02:00
|
|
|
* @phpcs:disable Squiz.Commenting.FunctionComment.TypeHintMissing
|
2019-05-09 15:00:05 +02:00
|
|
|
*/
|
|
|
|
|
protected function redirectTo($request)
|
|
|
|
|
{
|
2022-07-28 12:32:37 +02:00
|
|
|
// phpcs:enable
|
2019-05-09 15:00:05 +02:00
|
|
|
if (! $request->expectsJson()) {
|
|
|
|
|
return route('login');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|