Archived
1
0
Fork 0

Adding app/Http/Middleware/Authenticate.php

This commit is contained in:
Henrik Hautakoski 2021-12-31 17:24:08 +01:00
parent 13de198571
commit 6dbeaa5f77

View file

@ -0,0 +1,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 route('login');
}
}
}