42 lines
923 B
PHP
42 lines
923 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;
|
|
use Illuminate\Http\Request;
|
|
|
|
/**
|
|
* 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
|
|
* @return string|null
|
|
*/
|
|
protected function redirectTo(Request $request)
|
|
{
|
|
if (!$request->expectsJson()) {
|
|
return route('bo.login');
|
|
}
|
|
}
|
|
}
|