davide.cucurnia@vola.it
2024-02-01 398fc70ad81e71951105c4a950be0f8c4024bd01
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?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.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return string|null
     */
    protected function redirectTo($request)
    {
        if (! $request->expectsJson()) {
            return response('Unauthorized.', 401);
        }
    }
}