ldc-doux/app/Http/Middleware/Authenticate.php
2022-07-27 14:33:56 +02:00

42 lines
904 B
PHP

<?php
/**
* Middleware pour l'auth
*
* @category Description
* @package Category
* @author Name <email@email.com>
* @license http://url.com MIT
* @link http://url.com
* phpcs:ignore PEAR.Commenting.FileComment.MissingVersion
*/
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
/**
* Undocumented class
*
* @category Description
* @package Category
* @author Name <email@email.com>
* @license http://url.com MIT
* @link http://url.com
*/
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request La requête
*
* @return string|null
*/
protected function redirectTo($request)
{
if (!$request->expectsJson()) {
return route('bo.login');
}
}
}