1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-24 23:37:51 +01:00
openstamanager/app/Http/Middleware/Authenticate.php
2021-12-14 19:26:13 +01:00

20 lines
423 B
PHP

<?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.
*/
protected function redirectTo($request): string|null
{
if (!$request->expectsJson()) {
return route('auth.login');
}
return null;
}
}