1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-25 07:47:55 +01:00
openstamanager/app/Http/Middleware/Authenticate.php

20 lines
418 B
PHP
Raw Normal View History

2021-07-30 19:26:02 +02:00
<?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
2021-07-30 19:26:02 +02:00
{
if (!$request->expectsJson()) {
2021-07-30 19:26:02 +02:00
return route('login');
}
return null;
2021-07-30 19:26:02 +02:00
}
}