ldc-startcoq/app/Http/Middleware/Authenticate.php

21 lines
491 B
PHP
Raw Normal View History

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